axis2_http_response_writer.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_RESPONSE_WRITER_H
00018 #define AXIS2_HTTP_RESPONSE_WRITER_H
00019 
00031 #include <axis2_const.h>
00032 #include <axis2_defines.h>
00033 #include <axis2_env.h>
00034 #include <axis2_stream.h>
00035 
00036 #ifdef __cplusplus
00037 extern "C"
00038 {
00039 #endif
00040 
00042     typedef struct axis2_http_response_writer_ops axis2_http_response_writer_ops_t;
00044     typedef struct axis2_http_response_writer axis2_http_response_writer_t;
00045 
00046 
00051     struct axis2_http_response_writer_ops
00052     {
00057         axis2_char_t *(AXIS2_CALL *
00058                 get_encoding)(
00059                     const axis2_http_response_writer_t *response_writer,
00060                     const axis2_env_t *env);
00061 
00067         axis2_status_t (AXIS2_CALL *
00068                 close)(
00069                     axis2_http_response_writer_t *response_writer,
00070                     const axis2_env_t *env);
00071 
00077         axis2_status_t (AXIS2_CALL *
00078                 flush)(
00079                     axis2_http_response_writer_t *response_writer,
00080                     const axis2_env_t *env);
00081 
00088         axis2_status_t (AXIS2_CALL *
00089                 write_char)(
00090                     axis2_http_response_writer_t *response_writer,
00091                     const axis2_env_t *env,
00092                     char c);
00093 
00102         axis2_status_t (AXIS2_CALL *
00103                 write_buf)(
00104                     axis2_http_response_writer_t *response_writer,
00105                     const axis2_env_t *env,
00106                     char *buf,
00107                     int offset,
00108                     axis2_ssize_t len);
00109 
00116         axis2_status_t (AXIS2_CALL *
00117                 print_str)(
00118                     axis2_http_response_writer_t *response_writer,
00119                     const axis2_env_t *env,
00120                     const char *str);
00121 
00128         axis2_status_t (AXIS2_CALL *
00129                 print_int)(
00130                     axis2_http_response_writer_t *response_writer,
00131                     const axis2_env_t *env,
00132                     int i);
00133 
00140         axis2_status_t (AXIS2_CALL *
00141                 println_str)(
00142                     axis2_http_response_writer_t *response_writer,
00143                     const axis2_env_t *env,
00144                     const char *str);
00145 
00151         axis2_status_t (AXIS2_CALL *
00152                 println)(
00153                     axis2_http_response_writer_t *response_writer,
00154                     const axis2_env_t *env);
00155 
00161         axis2_status_t (AXIS2_CALL *
00162                 free)(
00163                     axis2_http_response_writer_t *response_writer,
00164                     const axis2_env_t *env);
00165     };
00166 
00170     struct axis2_http_response_writer
00171     {
00173         axis2_http_response_writer_ops_t *ops;
00174     };
00175 
00176 
00181     AXIS2_EXTERN axis2_http_response_writer_t *AXIS2_CALL
00182     axis2_http_response_writer_create (
00183         const axis2_env_t *env,
00184         axis2_stream_t *stream);
00185 
00191     AXIS2_EXTERN axis2_http_response_writer_t *AXIS2_CALL
00192     axis2_http_response_writer_create_with_encoding(
00193         const axis2_env_t *env,
00194         axis2_stream_t *stream,
00195         const axis2_char_t *encoding);
00196 
00197 /************************** Start of function macros **************************/
00198 
00201 #define AXIS2_HTTP_RESPONSE_WRITER_GET_ENCODING(response_writer, env) \
00202                     ((response_writer)->ops->get_encoding(response_writer, env))
00203 
00206 #define AXIS2_HTTP_RESPONSE_WRITER_CLOSE(response_writer, env) \
00207                     ((response_writer)->ops->close(response_writer, env))
00208 
00211 #define AXIS2_HTTP_RESPONSE_WRITER_FLUSH(response_writer, env) \
00212                     ((response_writer)->ops->flush(response_writer, env))
00213 
00216 #define AXIS2_HTTP_RESPONSE_WRITER_WRITE_CHAR(response_writer, env, c) \
00217                     ((response_writer)->ops->write_char(response_writer, env, c))
00218 
00221 #define AXIS2_HTTP_RESPONSE_WRITER_WRITE_BUF(response_writer, env, buf, offset,\
00222                     len) ((response_writer)->ops->write_buf(response_writer, \
00223                     env, buf, offset, len))
00224 
00227 #define AXIS2_HTTP_RESPONSE_WRITER_PRINT_STR(response_writer, env, str) \
00228                     ((response_writer)->ops->print_str(response_writer, env, str))
00229 
00232 #define AXIS2_HTTP_RESPONSE_WRITER_PRINT_INT(response_writer, env, i)\
00233                     ((response_writer)->ops->print_int(response_writer, env))
00234 
00237 #define AXIS2_HTTP_RESPONSE_WRITER_PRINTLN_STR(response_writer, env, str) \
00238                     ((response_writer)->ops->println_str(response_writer, env,\
00239                     str))
00240 
00243 #define AXIS2_HTTP_RESPONSE_WRITER_PRINTLN(response_writer, env) \
00244                     ((response_writer)->ops->println(response_writer, env))
00245 
00248 #define AXIS2_HTTP_RESPONSE_WRITER_FREE(response_writer, env)\
00249                     ((response_writer)->ops->free(response_writer, env))
00250 
00251 /************************** End of function macros ****************************/
00252 
00254 #ifdef __cplusplus
00255 }
00256 #endif
00257 
00258 #endif                          /* AXIS2_HTTP_RESPONSE_WRITER_H */

Generated on Thu Oct 26 21:00:11 2006 for Axis2/C by  doxygen 1.4.7