globus_common
15.26
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
globus_url.h
Go to the documentation of this file.
1
/*
2
* Copyright 1999-2006 University of Chicago
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
#ifndef GLOBUS_URL_H
18
#define GLOBUS_URL_H
19
34
#ifdef __cplusplus
35
extern
"C"
{
36
#endif
37
38
/* Supported URL Schemes */
49
typedef
enum
50
{
52
GLOBUS_URL_SCHEME_FTP
=0,
54
GLOBUS_URL_SCHEME_GSIFTP
,
56
GLOBUS_URL_SCHEME_HTTP
,
58
GLOBUS_URL_SCHEME_HTTPS
,
60
GLOBUS_URL_SCHEME_LDAP
,
62
GLOBUS_URL_SCHEME_FILE
,
64
GLOBUS_URL_SCHEME_X_NEXUS
,
66
GLOBUS_URL_SCHEME_X_GASS_CACHE
,
68
GLOBUS_URL_SCHEME_UNKNOWN
,
69
GLOBUS_URL_SCHEME_SSHFTP,
71
GLOBUS_URL_NUM_SCHEMES
72
}
globus_url_scheme_t
;
73
74
/*
75
Other schemes defined in RFCs but _not_ supported here are
76
'news', 'nntp', 'telnet', 'gopher', 'wais', 'mailto', and 'prospero'
77
*/
78
87
typedef
struct
88
{
90
char
*
scheme
;
91
93
globus_url_scheme_t
scheme_type
;
94
95
96
/*
97
* Other fields as seen in these known url schemes:
98
*
99
* ftp://[user[:password]@]host[:port]/[url_path]
100
* gsiftp://[user[:password]@]host[:port]/[url_path]
101
* http://host[:port]/url_path
102
* x-nexus://host:port
103
* x-gass-cache://url_path
104
* ldap://host[:port]/dn?attributes?scope?filter
105
* otherurl://host[:port]/url_path or
106
* otherurl://url_specific_part
107
*/
108
109
char
*
user
;
110
char
*
password
;
111
char
*host;
113
unsigned
short
port;
115
char
*url_path;
117
char
*dn;
119
char
*attributes;
121
char
*
scope
;
122
char
*filter;
125
char
*url_specific_part;
130
}
globus_url_t
;
131
132
/* Fill in the data structure pointed to by url */
133
int
globus_url_parse
(
const
char
*url_string,
globus_url_t
*url);
134
135
/* Fill in the data structure pointed to by url */
136
int
globus_url_parse_rfc1738
(
const
char
*url_string,
globus_url_t
*url);
137
138
/* Fill in the data structure pointed to by url */
139
int
globus_url_parse_loose
(
const
char
*url_string,
globus_url_t
*url);
140
141
/* Destroy the fields of the data structure pointed to by url */
142
int
globus_url_destroy
(
globus_url_t
*url);
143
144
/* Create a copy of a globus_url_t structure */
145
int
globus_url_copy
(
globus_url_t
* dest,
const
globus_url_t
* src);
146
147
/* Find out the URL scheme type */
148
int
globus_url_get_scheme
(
const
char
*url_string,
149
globus_url_scheme_t
*scheme_type);
150
151
152
void
153
globus_url_string_hex_decode(
154
char
* s);
155
156
char
*
157
globus_url_string_hex_encode(
158
const
char
* s,
159
const
char
* enc);
160
161
/* Return conditions */
162
#define GLOBUS_URL_SUCCESS 0
163
#define GLOBUS_URL_ERROR_NULL_STRING -1
164
#define GLOBUS_URL_ERROR_NULL_URL -2
165
#define GLOBUS_URL_ERROR_BAD_SCHEME -3
166
#define GLOBUS_URL_ERROR_BAD_USER -4
167
#define GLOBUS_URL_ERROR_BAD_PASSWORD -5
168
#define GLOBUS_URL_ERROR_BAD_HOST -6
169
#define GLOBUS_URL_ERROR_BAD_PORT -7
170
#define GLOBUS_URL_ERROR_BAD_PATH -8
171
172
/* for ldap URLs */
173
#define GLOBUS_URL_ERROR_BAD_DN -9
174
#define GLOBUS_URL_ERROR_BAD_ATTRIBUTES -10
175
#define GLOBUS_URL_ERROR_BAD_SCOPE -11
176
#define GLOBUS_URL_ERROR_BAD_FILTER -12
177
178
/* when malloc fails */
179
#define GLOBUS_URL_ERROR_OUT_OF_MEMORY -13
180
181
/* for nexus errors/former assertion failures */
182
#define GLOBUS_URL_ERROR_INTERNAL_ERROR -14
183
184
#define GLOBUS_URL_TRUE 1
185
#define GLOBUS_URL_FALSE 0
186
187
188
#ifdef __cplusplus
189
}
190
#endif
191
192
#endif
/* GLOBUS_URL_H */
Generated by
1.8.3.1