File: url.h

package info (click to toggle)
yafc 1.1.1.dfsg.1-4
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,248 kB
  • ctags: 1,679
  • sloc: ansic: 19,338; sh: 10,365; makefile: 155; perl: 38; ruby: 33
file content (59 lines) | stat: -rw-r--r-- 2,220 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* $Id: url.h,v 1.9 2002/02/23 13:16:30 mhe Exp $
 *
 * url.h -- splits an URL into its components
 *
 * Yet Another FTP Client
 * Copyright (C) 1998-2001, Martin Hedenfalk <mhe@stacken.kth.se>
 *
 * 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; either version 2 of the License, or
 * (at your option) any later version. See COPYING for more details.
 */

#ifndef _url_h_included
#define _url_h_included

#include "linklist.h"

typedef struct url_t {
	char *protocol;   /* "ssh", "ftp", ... */
	char *hostname;   /* hostname to connect to */
	char *alias;      /* other name for this url */
	char *username;   /* username to login with */
	char *password;   /* password to login with */
	char *directory;  /* startup directory */
	char *protlevel;  /* security protection level */
	int port;         /* port in host byte order */
	list *mech;       /* requested security mechanisms to try */
	bool noproxy;     /* don't connect via the configured proxy */
	int pasvmode;     /* true if passive mode is requested */
	char *sftp_server; /* path to remote sftp_server program */
	bool noupdate;    /* true if this bookmark should not be updated */
} url_t;

url_t *url_create(void);
url_t *url_init(const char *str);
void url_destroy(url_t *urlp);
url_t *url_clone(const url_t *urlp);

void url_parse(url_t *urlp, const char *str);
void url_setprotocol(url_t *urlp, const char *protocol);
void url_sethostname(url_t *urlp, const char *hostname);
void url_setalias(url_t *urlp, const char *alias);
void url_setusername(url_t *urlp, const char *username);
void url_setpassword(url_t *urlp, const char *password);
void url_setdirectory(url_t *urlp, const char *directory);
void url_setprotlevel(url_t *urlp, const char *protlevel);
void url_setport(url_t *urlp, int port);
void url_setmech(url_t *urlp, const char *mech_string);
void url_setpassive(url_t *urlp, int passive);
void url_setsftp(url_t *urlp, const char *sftp_server);

bool url_isanon(const url_t *url);

/* returns 0 if a == b */
int urlcmp(const url_t *a, const url_t *b);
int urlcmp_name(const url_t *a, const char *name);

#endif