X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ui%2Fcommon%2Furl.h;fp=ui%2Fcommon%2Furl.h;h=a966dc720574c938d96a0ed4497c30d4396db573;hb=8ecee33a2f5fb8562c4db7fa55f50f25a57dc8f3;hp=0000000000000000000000000000000000000000;hpb=764741bda57e79ff4d30cfb5eb5d01f11a89c29e;p=petitboot diff --git a/ui/common/url.h b/ui/common/url.h new file mode 100644 index 0000000..a966dc7 --- /dev/null +++ b/ui/common/url.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2009 Sony Computer Entertainment Inc. + * Copyright 2009 Sony Corp. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#if !defined(_PB_URL_PARSER_H) +#define _PB_URL_PARSER_H + +/** + * enum pb_url_scheme - Enumeration of the URL schemes we can handle. + */ + +enum pb_url_scheme { + pb_url_unknown = 0, + pb_url_file, + pb_url_ftp, + pb_url_http, + pb_url_https, + pb_url_nfs, + pb_url_sftp, + pb_url_tftp, +}; + +/** + * struct pb_url - Parsed URL info. + * @scheme: The enum pb_url_scheme for this URL. + * @full: The full URL = scheme://host:port/path. + * @host: The host part of URL. + * @port: The port part of URL. + * @path: The path part of URL. + * @dir: The dir part of path. + * @file: The file part of path. + * + * For info on URL syntax see: + * http://www.ietf.org/rfc/rfc3986.txt + */ + +struct pb_url { + enum pb_url_scheme scheme; + char *full; + char *host; + char *port; + char *path; + char *dir; + char *file; +}; + +struct pb_url *pb_url_parse(void *ctx, const char *url_str); + +#endif