FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
git2cpp/src/wasm/libgit2_internals.hpp at main · QuantStack/git2cpp · GitHub
QuantStack
git2cpp
Repository navigation
Code
Issues
6
(6)
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
git2cpp
/
src
/
wasm
/
libgit2_internals.hpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
66 lines (49 loc) · 1.98 KB
Breadcrumbs
git2cpp
/
src
/
wasm
/
libgit2_internals.hpp
Copy path
File metadata and controls
66 lines (49 loc) · 1.98 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#
pragma
once
#
ifdef
EMSCRIPTEN
#
include
<
optional
>
#
include
<
string
>
#
include
<
git2/sys/errors.h
>
#
include
<
git2/sys/transport.h
>
//
Libgit2 internals that we want to use so they are reproduced here in some form.
//
asserts
#
define
GIT_ASSERT
(
expr
)
GIT_ASSERT_WITH_RETVAL
(expr, -
1
)
#
define
GIT_ASSERT_ARG
(
expr
)
GIT_ASSERT_ARG_WITH_RETVAL
(expr, -
1
)
#
define
GIT_ASSERT_WITH_RETVAL
(
expr, fail
) \
GIT_ASSERT__WITH_RETVAL
(expr,
0
,
"
unrecoverable internal error
"
, fail)
#
define
GIT_ASSERT_ARG_WITH_RETVAL
(
expr, fail
)
GIT_ASSERT__WITH_RETVAL
(expr,
0
,
"
invalid argument
"
, fail)
#
define
GIT_ASSERT__WITH_RETVAL
(
expr, code, msg, fail
) \
do
\
{ \
if
(!(expr)) \
{ \
git_error_set
(code,
"
%s: '%s'
"
, msg, #expr); \
return
fail; \
} \
}
while
(
0
)
//
http status code, method and service.
#
define
GIT_HTTP_STATUS_CONTINUE
100
#
define
GIT_HTTP_STATUS_OK
200
#
define
GIT_HTTP_MOVED_PERMANENTLY
301
#
define
GIT_HTTP_FOUND
302
#
define
GIT_HTTP_SEE_OTHER
303
#
define
GIT_HTTP_TEMPORARY_REDIRECT
307
#
define
GIT_HTTP_PERMANENT_REDIRECT
308
#
define
GIT_HTTP_STATUS_UNAUTHORIZED
401
#
define
GIT_HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED
407
typedef
enum
{
GIT_HTTP_METHOD_GET
,
GIT_HTTP_METHOD_POST
,
GIT_HTTP_METHOD_CONNECT
} git_http_method;
typedef
struct
{
git_http_method m_method;
std::string m_url;
std::string m_request_type;
std::string m_response_type;
unsigned
int
m_initial :
1
, m_chunked :
1
;
} http_service;
std::string
name_for_method
(git_http_method method);
std::optional<http_service>
select_service
(
git_smart_service_t
action);
#
endif
//
EMSCRIPTEN
Back
|
FazBrowse Home
|
New Git URL