axis2_uri.h

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

Generated on Wed Dec 20 20:14:10 2006 for Axis2/C by  doxygen 1.5.1