💾 Archived View for gemini.rmf-dev.com › repo › Vaati › Vgmi › files › bf398324d88da5a9604c673f2c3c5… captured on 2023-03-20 at 18:00:17. Gemini links have been rewritten to link to archived content

View Raw

More Information

➡️ Next capture (2023-09-08)

-=-=-=-=-=-=-

0 /* See LICENSE file for copyright and license details. */

1 #ifndef _URL_H_

2 #define _URL_H_

3

4 #include <stdint.h>

5 #include <stddef.h>

6 #define MAX_URL 1024

7 #define PROTO_GEMINI 0

8 #define PROTO_HTTP 1

9 #define PROTO_HTTPS 2

10 #define PROTO_GOPHER 3

11 #define PROTO_FILE 4

12

13 int idn_to_ascii(const char* domain, size_t dlen, char* out, size_t outlen);

14 void parse_relative(const char* urlbuf, int host_len, char* buf);

15 int parse_url(const char* url, char* host, int host_len, char* buf,

16 int url_len, unsigned short* port);

17 int parse_query(const char* url, int len, char* buf, int llen);

18 int utf8_width(char* ptr, size_t len);

19 int utf8_len(char* ptr, size_t len);

20 int utf8_width_to(char* ptr, size_t len, size_t to);

21 int utf8_len_to(char* ptr, size_t len, size_t to_width);

22 int parse_link(char* data, int len);

23

24 #endif

25