00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef AXIS2_HTTP_RESPONSE_WRITER_H
00018 #define AXIS2_HTTP_RESPONSE_WRITER_H
00019
00020
00026 #include <axis2_const.h>
00027 #include <axis2_defines.h>
00028 #include <axis2_env.h>
00029 #include <axis2_stream.h>
00030
00031 #ifdef __cplusplus
00032 extern "C"
00033 {
00034 #endif
00035
00041 typedef struct axis2_http_response_writer_ops
00042 axis2_http_response_writer_ops_t;
00043 typedef struct axis2_http_response_writer axis2_http_response_writer_t;
00044
00045
00050 AXIS2_DECLARE_DATA struct axis2_http_response_writer_ops
00051 {
00052 axis2_char_t* (AXIS2_CALL *get_encoding)
00053 (axis2_http_response_writer_t *response_writer,
00054 const axis2_env_t *env);
00055
00056 axis2_status_t (AXIS2_CALL *close)
00057 (axis2_http_response_writer_t *response_writer,
00058 const axis2_env_t *env);
00059
00060 axis2_status_t (AXIS2_CALL *flush)
00061 (axis2_http_response_writer_t *response_writer,
00062 const axis2_env_t *env);
00063
00064 axis2_status_t (AXIS2_CALL *write_char)
00065 (axis2_http_response_writer_t *response_writer,
00066 const axis2_env_t *env, char c);
00067
00068 axis2_status_t (AXIS2_CALL *write_buf)
00069 (axis2_http_response_writer_t *response_writer,
00070 const axis2_env_t *env, char *buf, int offset,
00071 axis2_ssize_t len);
00072
00073 axis2_status_t (AXIS2_CALL *print_str)
00074 (axis2_http_response_writer_t *response_writer,
00075 const axis2_env_t *env,
00076 const char *str);
00077
00078 axis2_status_t (AXIS2_CALL *print_int)
00079 (axis2_http_response_writer_t *response_writer,
00080 const axis2_env_t *env, int i);
00081
00082 axis2_status_t (AXIS2_CALL *println_str)
00083 (axis2_http_response_writer_t *response_writer,
00084 const axis2_env_t *env,
00085 const char *str);
00086
00087 axis2_status_t (AXIS2_CALL *println)
00088 (axis2_http_response_writer_t *response_writer,
00089 const axis2_env_t *env);
00090
00091 axis2_status_t (AXIS2_CALL *free)
00092 (axis2_http_response_writer_t *response_writer,
00093 const axis2_env_t *env);
00094 };
00095
00100 AXIS2_DECLARE_DATA struct axis2_http_response_writer
00101 {
00102 axis2_http_response_writer_ops_t *ops;
00103 };
00104
00105
00106 AXIS2_EXTERN axis2_http_response_writer_t * AXIS2_CALL
00107 axis2_http_response_writer_create (const axis2_env_t *env, axis2_stream_t *stream);
00108
00109 AXIS2_EXTERN axis2_http_response_writer_t * AXIS2_CALL
00110 axis2_http_response_writer_create_with_encoding(const axis2_env_t *env,
00111 axis2_stream_t *stream, const axis2_char_t *encoding);
00112
00113
00114
00115 #define AXIS2_HTTP_RESPONSE_WRITER_GET_ENCODING(response_writer, env) \
00116 ((response_writer)->ops->get_encoding(response_writer, env))
00117 #define AXIS2_HTTP_RESPONSE_WRITER_CLOSE(response_writer, env) \
00118 ((response_writer)->ops->close(response_writer, env))
00119 #define AXIS2_HTTP_RESPONSE_WRITER_FLUSH(response_writer, env) \
00120 ((response_writer)->ops->flush(response_writer, env))
00121 #define AXIS2_HTTP_RESPONSE_WRITER_WRITE_CHAR(response_writer, env, c) \
00122 ((response_writer)->ops->write_char(response_writer, env, c))
00123 #define AXIS2_HTTP_RESPONSE_WRITER_WRITE_BUF(response_writer, env, buf, offset,\
00124 len) ((response_writer)->ops->write_buf(response_writer, \
00125 env, buf, offset, len))
00126 #define AXIS2_HTTP_RESPONSE_WRITER_PRINT_STR(response_writer, env, str) \
00127 ((response_writer)->ops->print_str(response_writer, env, str))
00128 #define AXIS2_HTTP_RESPONSE_WRITER_PRINT_INT(response_writer, env, i)\
00129 ((response_writer)->ops->print_int(response_writer, env))
00130 #define AXIS2_HTTP_RESPONSE_WRITER_PRINTLN_STR(response_writer, env, str) \
00131 ((response_writer)->ops->println_str(response_writer, env,\
00132 str))
00133 #define AXIS2_HTTP_RESPONSE_WRITER_PRINTLN(response_writer, env) \
00134 ((response_writer)->ops->println(response_writer, env))
00135 #define AXIS2_HTTP_RESPONSE_WRITER_FREE(response_writer, env)\
00136 ((response_writer)->ops->free(response_writer, env))
00137
00138
00139
00141 #ifdef __cplusplus
00142 }
00143 #endif
00144
00145 #endif