Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Examples

axis2_http_simple_request.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_HTTP_SIMPLE_REQUEST_H
00018 #define AXIS2_HTTP_SIMPLE_REQUEST_H
00019 
00020 
00026 #include <axis2_const.h>
00027 #include <axis2_defines.h>
00028 #include <axis2_env.h>
00029 #include <axis2_http_request_line.h>
00030 #include <axis2_http_header.h>
00031 #include <axis2_stream.h>
00032 #include <axis2_array_list.h>
00033 
00034 
00035 #ifdef __cplusplus
00036 extern "C"
00037 {
00038 #endif
00039 
00044     typedef struct axis2_http_simple_request_ops 
00045             axis2_http_simple_request_ops_t;
00046     typedef struct axis2_http_simple_request axis2_http_simple_request_t; 
00047     
00052 AXIS2_DECLARE_DATA struct axis2_http_simple_request_ops
00053 {
00054     axis2_http_request_line_t* (AXIS2_CALL *get_request_line)
00055                             (axis2_http_simple_request_t *simple_request, 
00056                             const axis2_env_t *env);
00057        
00058     axis2_status_t (AXIS2_CALL *set_request_line)
00059                             (axis2_http_simple_request_t *simple_request, 
00060                             const axis2_env_t *env, 
00061                             axis2_http_request_line_t *request_line);
00062     
00063     axis2_bool_t (AXIS2_CALL *contains_header)
00064                             (axis2_http_simple_request_t *simple_request, 
00065                             const axis2_env_t *env, 
00066                             const axis2_char_t *name);
00067 
00068     axis2_array_list_t* (AXIS2_CALL *get_headers)
00069                             (axis2_http_simple_request_t *simple_request, 
00070                             const axis2_env_t *env);
00071 
00072     axis2_http_header_t* (AXIS2_CALL *get_first_header)
00073                             (axis2_http_simple_request_t *simple_request, 
00074                             const axis2_env_t *env, const axis2_char_t *str);
00075 
00076     axis2_status_t (AXIS2_CALL *remove_headers)
00077                             (axis2_http_simple_request_t *simple_request, 
00078                             const axis2_env_t *env, const axis2_char_t *str);
00079 
00080     axis2_status_t (AXIS2_CALL *add_header)
00081                             (axis2_http_simple_request_t *simple_request, 
00082                             const axis2_env_t *env, axis2_http_header_t *header);
00083 
00084     const axis2_char_t* (AXIS2_CALL *get_content_type)
00085                             (axis2_http_simple_request_t *simple_request, 
00086                             const axis2_env_t *env);
00087 
00088     const axis2_char_t* (AXIS2_CALL *get_charset)
00089                             (axis2_http_simple_request_t *simple_request, 
00090                             const axis2_env_t *env);
00091 
00092     axis2_ssize_t (AXIS2_CALL *get_content_length)
00093                             (axis2_http_simple_request_t *simple_request, 
00094                             const axis2_env_t *env);
00095 
00096     axis2_stream_t* (AXIS2_CALL *get_body)
00097                             (axis2_http_simple_request_t *simple_request, 
00098                             const axis2_env_t *env);
00099 
00100     axis2_ssize_t (AXIS2_CALL *get_body_bytes)
00101                             (axis2_http_simple_request_t *simple_request, 
00102                             const axis2_env_t *env, char **buf);
00103                      
00104    axis2_status_t (AXIS2_CALL *set_body_string)
00105                           (axis2_http_simple_request_t *simple_request, 
00106                           const axis2_env_t *env, axis2_char_t *str);
00107 
00108     axis2_status_t (AXIS2_CALL *free)
00109                             (axis2_http_simple_request_t *simple_request, 
00110                             const axis2_env_t *env);
00111     
00112 };
00113 
00118 AXIS2_DECLARE_DATA struct axis2_http_simple_request
00119 {
00120     axis2_http_simple_request_ops_t *ops;    
00121 };
00122 
00123 
00124 AXIS2_EXTERN axis2_http_simple_request_t * AXIS2_CALL 
00125 axis2_http_simple_request_create (const axis2_env_t *env,
00126                         axis2_http_request_line_t *request_line,
00127                         axis2_http_header_t **http_headers,
00128                         axis2_ssize_t http_hdr_count,
00129                         axis2_stream_t *content);
00130     
00131 /************************** Start of function macros **************************/
00132 
00133 
00134 #define AXIS2_HTTP_SIMPLE_REQUEST_GET_REQUEST_LINE(simple_request, env) \
00135                             ((simple_request)->ops->get_request_line\
00136                             (simple_request, env))
00137 #define AXIS2_HTTP_SIMPLE_REQUEST_SET_REQUEST_LINE\
00138                             (simple_request, env, request_line) \
00139                             ((simple_request)->ops->set_request_line\
00140                             (simple_request, env, request_line))
00141 #define AXIS2_HTTP_SIMPLE_REQUEST_CONTAINS_HEADER(simple_request, env, name)\
00142                             ((simple_request)->ops->contains_header\
00143                             (simple_request, env, name))
00144 #define AXIS2_HTTP_SIMPLE_REQUEST_GET_HEADERS(simple_request, env)\
00145                             ((simple_request)->ops->get_headers(simple_request, env))
00146 #define AXIS2_HTTP_SIMPLE_REQUEST_GET_FIRST_HEADER(simple_request, env, str) \
00147                             ((simple_request)->ops->get_first_header\
00148                             (simple_request, env, str))
00149 #define AXIS2_HTTP_SIMPLE_REQUEST_REMOVE_HEADERS(simple_request, env, str) \
00150                             ((simple_request)->ops->remove_headers\
00151                             (simple_request, env, str))
00152 #define AXIS2_HTTP_SIMPLE_REQUEST_ADD_HEADER(simple_request, env, header) \
00153                             ((simple_request)->ops->add_header\
00154                             (simple_request, env, header))
00155 #define AXIS2_HTTP_SIMPLE_REQUEST_GET_CONTENT_TYPE(simple_request, env)\
00156                             ((simple_request)->ops->get_content_type\
00157                             (simple_request, env))
00158 #define AXIS2_HTTP_SIMPLE_REQUEST_GET_CHARSET(simple_request, env) \
00159                             ((simple_request)->ops->get_charset\
00160                             (simple_request, env))
00161 #define AXIS2_HTTP_SIMPLE_REQUEST_GET_CONTENT_LENGTH(simple_request, env)\
00162                             ((simple_request)->ops->get_content_length\
00163                             (simple_request, env))
00164 #define AXIS2_HTTP_SIMPLE_REQUEST_GET_BODY(simple_request, env)\
00165                             ((simple_request)->ops->get_body\
00166                             (simple_request, env))
00167 #define AXIS2_HTTP_SIMPLE_REQUEST_GET_BODY_BYTES(simple_request, env, buf)\
00168                             ((simple_request)->ops->get_body_bytes\
00169                             (simple_request, env, buf))
00170 #define AXIS2_HTTP_SIMPLE_REQUEST_SET_BODY_STRING(simple_request, env, str)\
00171                             ((simple_request)->ops->set_body_string\
00172                             (simple_request, env, str))
00173 #define AXIS2_HTTP_SIMPLE_REQUEST_FREE(simple_request, env) \
00174                             ((simple_request)->ops->free(simple_request, env))
00175 
00176 /************************** End of function macros ****************************/    
00177 
00179 #ifdef __cplusplus
00180 }
00181 #endif
00182 
00183 #endif                          /* AXIS2_HTTP_SIMPLE_REQUEST_H */

Generated on Fri Jun 16 18:02:31 2006 for Axis2/C by  doxygen 1.4.2