Mercurial > sci
comparison libsci/apic.h @ 33:1d0ddf9e6efd
misc: general documentation
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 04 Aug 2022 16:47:10 +0200 |
parents | lib/apic.h@dae2de19ca5d |
children | e52c762d8ba8 |
comparison
equal
deleted
inserted
replaced
32:081e1c258e64 | 33:1d0ddf9e6efd |
---|---|
1 /* | |
2 * apic.h -- synchronous HTTP request | |
3 * | |
4 * Copyright (c) 2021-2022 David Demelier <markand@malikania.fr> | |
5 * | |
6 * Permission to use, copy, modify, and/or distribute this software for any | |
7 * purpose with or without fee is hereby granted, provided that the above | |
8 * copyright notice and this permission notice appear in all copies. | |
9 * | |
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 */ | |
18 | |
19 #ifndef SCI_APIC_H | |
20 #define SCI_APIC_H | |
21 | |
22 #include <jansson.h> | |
23 | |
24 #define APIC_ERR_MAX 128 | |
25 | |
26 struct apic { | |
27 char error[APIC_ERR_MAX]; | |
28 long status; | |
29 }; | |
30 | |
31 extern struct apiconf { | |
32 char baseurl[512]; | |
33 } apiconf /*! Global variable. */; | |
34 | |
35 json_t * | |
36 apic_get(struct apic *, const char *, ...); | |
37 | |
38 json_t * | |
39 apic_post(struct apic *, const json_t *, const char *, ...); | |
40 | |
41 int | |
42 apic_job_add(struct apic *, json_t *); | |
43 | |
44 json_t * | |
45 apic_job_todo(struct apic *, const char *); | |
46 | |
47 int | |
48 apic_jobresult_add(struct apic *, json_t *); | |
49 | |
50 int | |
51 apic_project_save(struct apic *, json_t *); | |
52 | |
53 json_t * | |
54 apic_project_list(struct apic *); | |
55 | |
56 json_t * | |
57 apic_project_find(struct apic *, const char *); | |
58 | |
59 int | |
60 apic_worker_save(struct apic *, json_t *); | |
61 | |
62 json_t * | |
63 apic_worker_list(struct apic *); | |
64 | |
65 json_t * | |
66 apic_worker_find(struct apic *, const char *); | |
67 | |
68 #endif /* !SCI_APIC_H */ |