Blame


1 bfa33dbe 2021-04-22 op /*
2 bfa33dbe 2021-04-22 op * Copyright (c) 2021 Omar Polo <op@omarpolo.com>
3 bfa33dbe 2021-04-22 op *
4 bfa33dbe 2021-04-22 op * Permission to use, copy, modify, and distribute this software for any
5 bfa33dbe 2021-04-22 op * purpose with or without fee is hereby granted, provided that the above
6 bfa33dbe 2021-04-22 op * copyright notice and this permission notice appear in all copies.
7 bfa33dbe 2021-04-22 op *
8 bfa33dbe 2021-04-22 op * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 bfa33dbe 2021-04-22 op * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 bfa33dbe 2021-04-22 op * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 bfa33dbe 2021-04-22 op * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 bfa33dbe 2021-04-22 op * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 bfa33dbe 2021-04-22 op * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 bfa33dbe 2021-04-22 op * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 bfa33dbe 2021-04-22 op */
16 bfa33dbe 2021-04-22 op
17 bfa33dbe 2021-04-22 op /* for the time being, drop everything but the URL stuff */
18 bfa33dbe 2021-04-22 op
19 bfa33dbe 2021-04-22 op #ifndef PHOS_H
20 bfa33dbe 2021-04-22 op #define PHOS_H
21 bfa33dbe 2021-04-22 op
22 bfa33dbe 2021-04-22 op #ifdef __cplusplus
23 bfa33dbe 2021-04-22 op #extern "C" {
24 bfa33dbe 2021-04-22 op #endif
25 bfa33dbe 2021-04-22 op
26 bfa33dbe 2021-04-22 op #include <stdint.h>
27 bfa33dbe 2021-04-22 op
28 bfa33dbe 2021-04-22 op #define PHOS_URL_MAX_LEN 1024
29 bfa33dbe 2021-04-22 op
30 bfa33dbe 2021-04-22 op struct phos_uri {
31 bfa33dbe 2021-04-22 op char scheme[32];
32 bfa33dbe 2021-04-22 op char host[1024];
33 bfa33dbe 2021-04-22 op char port[6];
34 bfa33dbe 2021-04-22 op uint16_t dec_port;
35 bfa33dbe 2021-04-22 op char path[1024];
36 bfa33dbe 2021-04-22 op char query[1024];
37 bfa33dbe 2021-04-22 op char fragment[32];
38 bfa33dbe 2021-04-22 op };
39 bfa33dbe 2021-04-22 op
40 bfa33dbe 2021-04-22 op /* phos_uri.c */
41 bfa33dbe 2021-04-22 op int phos_parse_uri_reference(const char*, struct phos_uri*);
42 bfa33dbe 2021-04-22 op int phos_parse_absolute_uri(const char*, struct phos_uri*);
43 bfa33dbe 2021-04-22 op int phos_resolve_uri_from_str(const struct phos_uri*, const char *, struct phos_uri*);
44 bfa33dbe 2021-04-22 op void phos_uri_drop_empty_segments(struct phos_uri*);
45 4190a5c2 2021-04-24 op int phos_uri_set_query(struct phos_uri*, const char*);
46 bfa33dbe 2021-04-22 op int phos_serialize_uri(const struct phos_uri*, char*, size_t);
47 bfa33dbe 2021-04-22 op
48 bfa33dbe 2021-04-22 op #ifdef __cplusplus
49 bfa33dbe 2021-04-22 op }
50 bfa33dbe 2021-04-22 op #endif
51 bfa33dbe 2021-04-22 op
52 bfa33dbe 2021-04-22 op #endif /* PHOS_H */