axis2_http_response_writer.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_HTTP_RESPONSE_WRITER_H
00019 #define AXIS2_HTTP_RESPONSE_WRITER_H
00020 
00032 #include <axis2_const.h>
00033 #include <axis2_defines.h>
00034 #include <axis2_env.h>
00035 #include <axis2_stream.h>
00036 
00037 #ifdef __cplusplus
00038 extern "C"
00039 {
00040 #endif
00041 
00043     typedef struct axis2_http_response_writer_ops axis2_http_response_writer_ops_t;
00045     typedef struct axis2_http_response_writer axis2_http_response_writer_t;
00046 
00047 
00052     struct axis2_http_response_writer_ops
00053     {
00058         axis2_char_t *(AXIS2_CALL *
00059                 get_encoding)(
00060                     const axis2_http_response_writer_t *response_writer,
00061                     const axis2_env_t *env);
00062 
00068         axis2_status_t (AXIS2_CALL *
00069                 close)(
00070                     axis2_http_response_writer_t *response_writer,
00071                     const axis2_env_t *env);
00072 
00078         axis2_status_t (AXIS2_CALL *
00079                 flush)(
00080                     axis2_http_response_writer_t *response_writer,
00081                     const axis2_env_t *env);
00082 
00089         axis2_status_t (AXIS2_CALL *
00090                 write_char)(
00091                     axis2_http_response_writer_t *response_writer,
00092                     const axis2_env_t *env,
00093                     char c);
00094 
00103         axis2_status_t (AXIS2_CALL *
00104                 write_buf)(
00105                     axis2_http_response_writer_t *response_writer,
00106                     const axis2_env_t *env,
00107                     char *buf,
00108                     int offset,
00109                     axis2_ssize_t len);
00110 
00117         axis2_status_t (AXIS2_CALL *
00118                 print_str)(
00119                     axis2_http_response_writer_t *response_writer,
00120                     const axis2_env_t *env,
00121                     const char *str);
00122 
00129         axis2_status_t (AXIS2_CALL *
00130                 print_int)(
00131                     axis2_http_response_writer_t *response_writer,
00132                     const axis2_env_t *env,
00133                     int i);
00134 
00141         axis2_status_t (AXIS2_CALL *
00142                 println_str)(
00143                     axis2_http_response_writer_t *response_writer,
00144                     const axis2_env_t *env,
00145                     const char *str);
00146 
00152         axis2_status_t (AXIS2_CALL *
00153                 println)(
00154                     axis2_http_response_writer_t *response_writer,
00155                     const axis2_env_t *env);
00156 
00162         axis2_status_t (AXIS2_CALL *
00163                 free)(
00164                     axis2_http_response_writer_t *response_writer,
00165                     const axis2_env_t *env);
00166     };
00167 
00171     struct axis2_http_response_writer
00172     {
00174         axis2_http_response_writer_ops_t *ops;
00175     };
00176 
00177 
00182     AXIS2_EXTERN axis2_http_response_writer_t *AXIS2_CALL
00183     axis2_http_response_writer_create (
00184         const axis2_env_t *env,
00185         axis2_stream_t *stream);
00186 
00192     AXIS2_EXTERN axis2_http_response_writer_t *AXIS2_CALL
00193     axis2_http_response_writer_create_with_encoding(
00194         const axis2_env_t *env,
00195         axis2_stream_t *stream,
00196         const axis2_char_t *encoding);
00197 
00198 /************************** Start of function macros **************************/
00199 
00202 #define AXIS2_HTTP_RESPONSE_WRITER_GET_ENCODING(response_writer, env) \
00203                     ((response_writer)->ops->get_encoding(response_writer, env))
00204 
00207 #define AXIS2_HTTP_RESPONSE_WRITER_CLOSE(response_writer, env) \
00208                     ((response_writer)->ops->close(response_writer, env))
00209 
00212 #define AXIS2_HTTP_RESPONSE_WRITER_FLUSH(response_writer, env) \
00213                     ((response_writer)->ops->flush(response_writer, env))
00214 
00217 #define AXIS2_HTTP_RESPONSE_WRITER_WRITE_CHAR(response_writer, env, c) \
00218                     ((response_writer)->ops->write_char(response_writer, env, c))
00219 
00222 #define AXIS2_HTTP_RESPONSE_WRITER_WRITE_BUF(response_writer, env, buf, offset,\
00223                     len) ((response_writer)->ops->write_buf(response_writer, \
00224                     env, buf, offset, len))
00225 
00228 #define AXIS2_HTTP_RESPONSE_WRITER_PRINT_STR(response_writer, env, str) \
00229                     ((response_writer)->ops->print_str(response_writer, env, str))
00230 
00233 #define AXIS2_HTTP_RESPONSE_WRITER_PRINT_INT(response_writer, env, i)\
00234                     ((response_writer)->ops->print_int(response_writer, env))
00235 
00238 #define AXIS2_HTTP_RESPONSE_WRITER_PRINTLN_STR(response_writer, env, str) \
00239                     ((response_writer)->ops->println_str(response_writer, env,\
00240                     str))
00241 
00244 #define AXIS2_HTTP_RESPONSE_WRITER_PRINTLN(response_writer, env) \
00245                     ((response_writer)->ops->println(response_writer, env))
00246 
00249 #define AXIS2_HTTP_RESPONSE_WRITER_FREE(response_writer, env)\
00250                     ((response_writer)->ops->free(response_writer, env))
00251 
00252 /************************** End of function macros ****************************/
00253 
00255 #ifdef __cplusplus
00256 }
00257 #endif
00258 
00259 #endif                          /* AXIS2_HTTP_RESPONSE_WRITER_H */

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