]>
git.proxmox.com Git - libgit2.git/blob - src/stream.h
2 * Copyright (C) the libgit2 contributors. All rights reserved.
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.
7 #ifndef INCLUDE_stream_h__
8 #define INCLUDE_stream_h__
11 #include "git2/sys/stream.h"
13 GIT_INLINE(int) git_stream_connect(git_stream
*st
)
15 return st
->connect(st
);
18 GIT_INLINE(int) git_stream_is_encrypted(git_stream
*st
)
23 GIT_INLINE(int) git_stream_certificate(git_cert
**out
, git_stream
*st
)
26 giterr_set(GITERR_INVALID
, "an unencrypted stream does not have a certificate");
30 return st
->certificate(out
, st
);
33 GIT_INLINE(int) git_stream_supports_proxy(git_stream
*st
)
35 return st
->proxy_support
;
38 GIT_INLINE(int) git_stream_set_proxy(git_stream
*st
, const char *proxy_url
)
40 if (!st
->proxy_support
) {
41 giterr_set(GITERR_INVALID
, "proxy not supported on this stream");
45 return st
->set_proxy(st
, proxy_url
);
48 GIT_INLINE(ssize_t
) git_stream_read(git_stream
*st
, void *data
, size_t len
)
50 return st
->read(st
, data
, len
);
53 GIT_INLINE(ssize_t
) git_stream_write(git_stream
*st
, const char *data
, size_t len
, int flags
)
55 return st
->write(st
, data
, len
, flags
);
58 GIT_INLINE(int) git_stream_close(git_stream
*st
)
63 GIT_INLINE(void) git_stream_free(git_stream
*st
)