SCTC
the soundcloud.com terminal client
url.h
Go to the documentation of this file.
1 /*
2  SCTC - the soundcloud.com client
3  Copyright (C) 2015 Christian Eichler
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>
17 */
18 
19 #ifndef _URL_H
20  #define _URL_H
21 
22  #include <stdbool.h>
23 
24  struct url {
25  char *scheme;
26  char *user;
27  char *pass;
28  char *host;
29  int port;
30  char *request;
31 
32  struct network_conn *nwc;
33  };
34 
35  struct url* url_parse_string(char *str);
36  bool url_connect(struct url *u);
37  void url_destroy(struct url *u);
38 
39 #endif /* _URL_H */
char * scheme
Definition: url.h:25
char * request
the port
Definition: url.h:30
Definition: url.h:24
bool url_connect(struct url *u)
Definition: url.c:135
char * user
the scheme, currently 'only' "http" and "https"
Definition: url.h:26
struct network_conn * nwc
the request itself, without scheme://[user[:pass]@]host[:port]
Definition: url.h:32
Definition: network.h:41
int port
the host
Definition: url.h:29
void url_destroy(struct url *u)
Definition: url.c:146
char * host
the corresponding password
Definition: url.h:28
char * pass
the user
Definition: url.h:27
struct url * url_parse_string(char *str)
Definition: url.c:31