]> git.proxmox.com Git - libgit2.git/blame - src/netops.h
Add git_remote_new
[libgit2.git] / src / netops.h
CommitLineData
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
8typedef int GIT_SOCKET;
9#else
10typedef unsigned int GIT_SOCKET;
11#endif
12
ea7a5452 13typedef 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 20void gitno_buffer_setup(gitno_buffer *buf, char *data, unsigned int len, int fd);
ea7a5452 21int gitno_recv(gitno_buffer *buf);
c7c787ce 22void gitno_consume(gitno_buffer *buf, const char *ptr);
ea7a5452
CMN
23void gitno_consume_n(gitno_buffer *buf, unsigned int cons);
24
1b4f8140 25int gitno_connect(const char *host, const char *port);
4e95ef02 26int gitno_send(int s, const char *msg, int len, int flags);
74bd343a 27int gitno_select_in(gitno_buffer *buf, long int sec, long int usec);
1b4f8140
CMN
28
29#endif