axis2_uri.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2004,2005 The Apache Software Foundation.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #ifndef AXIS2_URI_H
00018 #define AXIS2_URI_H
00019 
00026 #include <axis2_string.h>
00027 #include <axis2_utils.h>
00028 #include <axis2_utils_defines.h>
00029 #include <axis2_env.h>
00030 
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034 
00041 #define AXIS2_URI_FTP_DEFAULT_PORT         21 
00042 #define AXIS2_URI_SSH_DEFAULT_PORT         22 
00043 #define AXIS2_URI_TELNET_DEFAULT_PORT      23 
00044 #define AXIS2_URI_GOPHER_DEFAULT_PORT      70 
00045 #define AXIS2_URI_HTTP_DEFAULT_PORT        80 
00046 #define AXIS2_URI_POP_DEFAULT_PORT        110 
00047 #define AXIS2_URI_NNTP_DEFAULT_PORT       119 
00048 #define AXIS2_URI_IMAP_DEFAULT_PORT       143 
00049 #define AXIS2_URI_PROSPERO_DEFAULT_PORT   191 
00050 #define AXIS2_URI_WAIS_DEFAULT_PORT       210 
00051 #define AXIS2_URI_LDAP_DEFAULT_PORT       389 
00052 #define AXIS2_URI_HTTPS_DEFAULT_PORT      443 
00053 #define AXIS2_URI_RTSP_DEFAULT_PORT       554 
00054 #define AXIS2_URI_SNEWS_DEFAULT_PORT      563 
00055 #define AXIS2_URI_ACAP_DEFAULT_PORT       674 
00056 #define AXIS2_URI_NFS_DEFAULT_PORT       2049 
00057 #define AXIS2_URI_TIP_DEFAULT_PORT       3372 
00058 #define AXIS2_URI_SIP_DEFAULT_PORT       5060 
00062 #define AXIS2_URI_UNP_OMITSITEPART    (1U<<0)
00063 
00064 #define AXIS2_URI_UNP_OMITUSER        (1U<<1)
00065 
00066 #define AXIS2_URI_UNP_OMITPASSWORD    (1U<<2)
00067 
00068 #define AXIS2_URI_UNP_OMITUSERINFO    (AXIS2_URI_UNP_OMITUSER | \
00069                                      AXIS2_URI_UNP_OMITPASSWORD)
00070 
00071 #define AXIS2_URI_UNP_REVEALPASSWORD  (1U<<3)
00072 
00073 #define AXIS2_URI_UNP_OMITPATHINFO    (1U<<4)
00074 
00075 #define AXIS2_URI_UNP_OMITQUERY       (1U<<5)
00076 
00078 typedef  unsigned short  axis2_port_t;
00079 /* axis2_uri.c */
00080 
00081 
00082 typedef struct axis2_uri_ops axis2_uri_ops_t;
00083 typedef struct axis2_uri axis2_uri_t;
00084 
00085     
00090  struct axis2_uri_ops
00091 {
00092 
00093     axis2_status_t (AXIS2_CALL *
00094     free) (
00095             axis2_uri_t *uri, 
00096             const axis2_env_t *env);
00097  
00114     axis2_char_t* (AXIS2_CALL *
00115     to_string) (
00116             const axis2_uri_t *uri, 
00117             const axis2_env_t *env,
00118             unsigned flags);
00119    
00120     axis2_char_t* (AXIS2_CALL *
00121     get_protocol) (
00122             axis2_uri_t *uri, 
00123             const axis2_env_t *env);
00124    
00125     axis2_char_t* (AXIS2_CALL *
00126     get_server)(
00127             axis2_uri_t *uri, 
00128             const axis2_env_t *env);
00129             
00130     axis2_port_t (AXIS2_CALL *
00131     get_port) (
00132             axis2_uri_t *uri, 
00133             const axis2_env_t *env);
00134             
00135     axis2_char_t* (AXIS2_CALL *
00136     get_path)(
00137             axis2_uri_t *uri, 
00138             const axis2_env_t *env);
00139 
00140     axis2_uri_t* (AXIS2_CALL *
00141     clone) (
00142             const axis2_uri_t *uri,
00143             const axis2_env_t *env);
00144 };
00145 
00150  struct axis2_uri
00151 {
00152     axis2_uri_ops_t *ops;    
00153 };
00154 
00161 AXIS2_EXTERN axis2_port_t AXIS2_CALL
00162 axis2_uri_port_of_scheme(
00163         const axis2_char_t *scheme_str);
00164 
00173 AXIS2_EXTERN axis2_uri_t *AXIS2_CALL
00174 axis2_uri_parse_string(
00175         const axis2_env_t *env, 
00176         const axis2_char_t *uri);
00177 
00184 AXIS2_EXTERN axis2_uri_t *AXIS2_CALL
00185 axis2_uri_parse_hostinfo(
00186         const axis2_env_t *env, 
00187         const axis2_char_t *hostinfo);
00188 
00190 AXIS2_EXTERN axis2_uri_t *AXIS2_CALL 
00191 axis2_uri_resolve_relative(
00192         const axis2_env_t *env,
00193         const axis2_uri_t* base,
00194         axis2_uri_t* uptr);
00195 
00208 AXIS2_EXTERN axis2_uri_t *AXIS2_CALL 
00209 axis2_uri_parse_relative(
00210         const axis2_env_t *env,
00211         const axis2_uri_t* base,
00212         const char* uri);
00213 
00214 /************************** Start of function macros **************************/
00215       
00216 #define AXIS2_URI_FREE(uri, env) \
00217       ((uri)->ops->free(uri, env))
00218 
00219 #define AXIS2_URI_TO_STRING(uri, env, flags) \
00220       (((axis2_uri_t *) uri)->ops->to_string(uri, env, flags))
00221 
00222 #define AXIS2_URI_GET_PROTOCOL(uri, env) \
00223       ((uri)->ops->get_protocol(uri, env))
00224       
00225 #define AXIS2_URI_GET_SERVER(uri, env) \
00226       ((uri)->ops->get_server(uri, env))
00227       
00228 #define AXIS2_URI_GET_PORT(uri, env) \
00229       ((uri)->ops->get_port(uri, env))
00230       
00231 #define AXIS2_URI_GET_PATH(uri, env) \
00232       ((uri)->ops->get_path(uri, env))
00233       
00234 #define AXIS2_URI_CLONE(uri, env) \
00235       ((uri)->ops->clone(uri, env))
00236 
00237 /************************** End of function macros ****************************/    
00238 
00240 #ifdef __cplusplus
00241 }
00242 #endif
00243 
00244 #endif /* AXIS2_URI_H */

Generated on Tue Oct 3 20:47:59 2006 for Axis2/C by  doxygen 1.4.7