|
diff --git a/shared.c b/shared.c index cd60da5..48002ac 100644 --- a/ shared.c+++ b/ shared.c |
|
@@ -1,40 +1,38 @@ |
1 | /* shared.c: global vars + some callback functions |
1 | /* shared.c: global vars + some callback functions |
2 | * |
2 | * |
3 | * Copyright (C) 2006 Lars Hjemli |
3 | * Copyright (C) 2006 Lars Hjemli |
4 | * |
4 | * |
5 | * Licensed under GNU General Public License v2 |
5 | * Licensed under GNU General Public License v2 |
6 | * (see COPYING for full license text) |
6 | * (see COPYING for full license text) |
7 | */ |
7 | */ |
8 | |
8 | |
9 | #include "cgit.h" |
9 | #include "cgit.h" |
10 | |
10 | |
11 | struct cgit_repolist cgit_repolist; |
11 | struct cgit_repolist cgit_repolist; |
12 | struct cgit_context ctx; |
12 | struct cgit_context ctx; |
13 | int cgit_cmd; |
13 | int cgit_cmd; |
14 | |
14 | |
15 | const char *cgit_version = CGIT_VERSION; |
| |
16 | |
| |
17 | int chk_zero(int result, char *msg) |
15 | int chk_zero(int result, char *msg) |
18 | { |
16 | { |
19 | if (result != 0) |
17 | if (result != 0) |
20 | die("%s: %s", msg, strerror(errno)); |
18 | die("%s: %s", msg, strerror(errno)); |
21 | return result; |
19 | return result; |
22 | } |
20 | } |
23 | |
21 | |
24 | int chk_positive(int result, char *msg) |
22 | int chk_positive(int result, char *msg) |
25 | { |
23 | { |
26 | if (result <= 0) |
24 | if (result <= 0) |
27 | die("%s: %s", msg, strerror(errno)); |
25 | die("%s: %s", msg, strerror(errno)); |
28 | return result; |
26 | return result; |
29 | } |
27 | } |
30 | |
28 | |
31 | int chk_non_negative(int result, char *msg) |
29 | int chk_non_negative(int result, char *msg) |
32 | { |
30 | { |
33 | if (result < 0) |
31 | if (result < 0) |
34 | die("%s: %s",msg, strerror(errno)); |
32 | die("%s: %s",msg, strerror(errno)); |
35 | return result; |
33 | return result; |
36 | } |
34 | } |
37 | |
35 | |
38 | struct cgit_repo *cgit_add_repo(const char *url) |
36 | struct cgit_repo *cgit_add_repo(const char *url) |
39 | { |
37 | { |
40 | struct cgit_repo *ret; |
38 | struct cgit_repo *ret; |
|