include/apr_uri.h

Go to the documentation of this file.
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  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 /*
00018  * apr_uri.h: External Interface of apr_uri.c
00019  */
00020 
00026 #ifndef APR_URI_H
00027 #define APR_URI_H
00028 
00029 #include "apu.h"
00030 
00031 #include "apr_network_io.h"
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036 
00043 #define APR_URI_FTP_DEFAULT_PORT         21 
00044 #define APR_URI_SSH_DEFAULT_PORT         22 
00045 #define APR_URI_TELNET_DEFAULT_PORT      23 
00046 #define APR_URI_GOPHER_DEFAULT_PORT      70 
00047 #define APR_URI_HTTP_DEFAULT_PORT        80 
00048 #define APR_URI_POP_DEFAULT_PORT        110 
00049 #define APR_URI_NNTP_DEFAULT_PORT       119 
00050 #define APR_URI_IMAP_DEFAULT_PORT       143 
00051 #define APR_URI_PROSPERO_DEFAULT_PORT   191 
00052 #define APR_URI_WAIS_DEFAULT_PORT       210 
00053 #define APR_URI_LDAP_DEFAULT_PORT       389 
00054 #define APR_URI_HTTPS_DEFAULT_PORT      443 
00055 #define APR_URI_RTSP_DEFAULT_PORT       554 
00056 #define APR_URI_SNEWS_DEFAULT_PORT      563 
00057 #define APR_URI_ACAP_DEFAULT_PORT       674 
00058 #define APR_URI_NFS_DEFAULT_PORT       2049 
00059 #define APR_URI_TIP_DEFAULT_PORT       3372 
00060 #define APR_URI_SIP_DEFAULT_PORT       5060 
00064 #define APR_URI_UNP_OMITSITEPART    (1U<<0)
00065 
00066 #define APR_URI_UNP_OMITUSER        (1U<<1)
00067 
00068 #define APR_URI_UNP_OMITPASSWORD    (1U<<2)
00069 
00070 #define APR_URI_UNP_OMITUSERINFO    (APR_URI_UNP_OMITUSER | \
00071                                      APR_URI_UNP_OMITPASSWORD)
00072 
00073 #define APR_URI_UNP_REVEALPASSWORD  (1U<<3)
00074 
00075 #define APR_URI_UNP_OMITPATHINFO    (1U<<4)
00076 
00077 #define APR_URI_UNP_OMITQUERY       (1U<<5)
00078 
00080 typedef struct apr_uri_t apr_uri_t;
00081 
00085 struct apr_uri_t {
00087     char *scheme;
00089     char *hostinfo;
00091     char *user;
00093     char *password;
00095     char *hostname;
00097     char *port_str;
00099     char *path;
00101     char *query;
00103     char *fragment;
00104 
00106     struct hostent *hostent;
00107 
00109     apr_port_t port;
00110     
00112     unsigned is_initialized:1;
00113 
00115     unsigned dns_looked_up:1;
00117     unsigned dns_resolved:1;
00118 };
00119 
00120 /* apr_uri.c */
00127 APU_DECLARE(apr_port_t) apr_uri_port_of_scheme(const char *scheme_str);
00128 
00146 APU_DECLARE(char *) apr_uri_unparse(apr_pool_t *p, 
00147                                     const apr_uri_t *uptr,
00148                                     unsigned flags);
00149 
00159 APU_DECLARE(apr_status_t) apr_uri_parse(apr_pool_t *p, const char *uri, 
00160                                         apr_uri_t *uptr);
00161 
00169 APU_DECLARE(apr_status_t) apr_uri_parse_hostinfo(apr_pool_t *p, 
00170                                                  const char *hostinfo, 
00171                                                  apr_uri_t *uptr);
00172 
00174 #ifdef __cplusplus
00175 }
00176 #endif
00177 
00178 #endif /* APR_URI_H */

Generated on Mon Nov 26 11:24:10 2007 for Apache Portable Runtime Utility Library by  doxygen 1.5.2