Plan 9 from Bell Labs’s /usr/web/sources/contrib/uriel/liburl/url.h

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#pragma	lib	"liburl.a"
#pragma src "/sys/src/liburl"
/*
 * If ischeme is USunknown, then the given URL is a relative
 * URL which references the "current document" in the context of the base.
 * If this is the case, only the "fragment" and "url" members will have
 * meaning, and the given URL structure may not be used as a base URL itself.
 */
enum
{
	USunknown,
	UShttp,
	UShttps,
	USftp,
	USfile,
	UScurrent,
};

typedef struct Url Url;
struct Url
{
	int ischeme;
	char *url;
	char *scheme;
	char *schemedata;
	char *authority;
	char *user;
	char *passwd;
	char *host;
	char *port;
	char *path;
	char *query;
	char *fragment;
	void *aux;
	union {
		struct {
			char *page_spec;
		} http;
		struct {
			char *path_spec;
			char *type;
		} ftp;
	};
};

/* url.c */
Url * parseurl(char*, Url*);
void  freeurl(Url*);
void  rewriteurl(Url*);
int  seturlquery(Url*, char*);
Url * copyurl(Url*);
char *escapeurl(char*, int(*)(int));
char *unescapeurl(char*);
void  initurl(void);

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.