spa/url.h

28 lines
600 B
C

#define URL_MAX 2044
typedef struct sUrl {
U8 oHost;
U8 oPath;
U16 oFile;
U16 port; // _ACTUAL_ port number specified in the URL,
U16 res;
char buf[URL_MAX];
} sUrl;
int url_is_spartan(char* url);
int url_is_full(char* url);
U32 host_port(char* host);
void sUrl_dump(sUrl* purl);
int sUrl_set(sUrl*p,char*str,U32 len);
sUrl* sUrl_copy(sUrl* dst, sUrl* src);
char* sUrl_file(sUrl* purl);
int sUrl_full(sUrl* purl);
void sUrl_rel(sUrl*purl,char* str,U32 len);
int sUrl_norm(sUrl* purl);
char* sUrl_path(sUrl* purl);
U16 sUrl_port(sUrl* purl);
U32 sUrl_host_length(sUrl* purl);