You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2007/03/30 09:20:02 UTC
svn commit: r523972 - in /webservices/axis2/trunk/c:
include/axis2_http_response_writer.h
modules/core/transport/http/receiver/http_response_writer.c
Author: samisa
Date: Fri Mar 30 00:20:01 2007
New Revision: 523972
URL: http://svn.apache.org/viewvc?view=rev&rev=523972
Log:
Removed ops
Modified:
webservices/axis2/trunk/c/include/axis2_http_response_writer.h
webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_response_writer.c
Modified: webservices/axis2/trunk/c/include/axis2_http_response_writer.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_http_response_writer.h?view=diff&rev=523972&r1=523971&r2=523972
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_http_response_writer.h (original)
+++ webservices/axis2/trunk/c/include/axis2_http_response_writer.h Fri Mar 30 00:20:01 2007
@@ -39,141 +39,112 @@
{
#endif
- /** Type name for struct axis2_http_response_writer_ops */
- typedef struct axis2_http_response_writer_ops axis2_http_response_writer_ops_t;
/** Type name for struct axis2_http_response_writer */
typedef struct axis2_http_response_writer axis2_http_response_writer_t;
/**
- * HTTP Response Writer ops struct
- * Encapsulator struct for ops of axis2_http_response_writer
+ * @param response_writer pointer to response writer
+ * @param env pointer to environment struct
+ */
+ AXIS2_EXTERN axis2_char_t *AXIS2_CALL
+ axis2_http_response_writer_get_encoding(const axis2_http_response_writer_t *response_writer,
+ const axis2_env_t *env);
+
+ /**
+ * @param response_writer pointer to response writer
+ * @param env pointer to environment struct
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+ */
+ AXIS2_EXTERN axis2_status_t AXIS2_CALL
+ axis2_http_response_writer_close(axis2_http_response_writer_t *response_writer,
+ const axis2_env_t *env);
+
+ /**
+ * @param response_writer pointer to response writer
+ * @param env pointer to environment struct
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+ */
+ AXIS2_EXTERN axis2_status_t AXIS2_CALL
+ axis2_http_response_writer_flush(axis2_http_response_writer_t *response_writer,
+ const axis2_env_t *env);
+
+ /**
+ * @param response_writer pointer to response writer
+ * @param env pointer to environment struct
+ * @param c
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
*/
- struct axis2_http_response_writer_ops
- {
- /**
- * @param response_writer pointer to response writer
- * @param env pointer to environment struct
- */
- axis2_char_t *(AXIS2_CALL *
- get_encoding)(
- const axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env);
-
- /**
- * @param response_writer pointer to response writer
- * @param env pointer to environment struct
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
- axis2_status_t (AXIS2_CALL *
- close)(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env);
-
- /**
- * @param response_writer pointer to response writer
- * @param env pointer to environment struct
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
- axis2_status_t (AXIS2_CALL *
- flush)(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env);
-
- /**
- * @param response_writer pointer to response writer
- * @param env pointer to environment struct
- * @param c
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
- axis2_status_t (AXIS2_CALL *
- write_char)(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env,
- char c);
-
- /**
- * @param response_writer pointer to response writer
- * @param env pointer to environment struct
- * @param buf pointer to buf
- * @param offset
- * @param len
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
- axis2_status_t (AXIS2_CALL *
- write_buf)(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env,
- char *buf,
- int offset,
- axis2_ssize_t len);
-
- /**
- * @param response_writer pointer to response writer
- * @param env pointer to environment struct
- * @param str pointer to str
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
- axis2_status_t (AXIS2_CALL *
- print_str)(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env,
- const char *str);
-
- /**
- * @param response_writer pointer to response writer
- * @param env pointer to environment struct
- * @param i
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
- axis2_status_t (AXIS2_CALL *
- print_int)(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env,
- int i);
-
- /**
- * @param response_writer pointer to response writer
- * @param env pointer to environment struct
- * @param str pointer to str
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
- axis2_status_t (AXIS2_CALL *
- println_str)(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env,
- const char *str);
-
- /**
- * @param response_writer pointer to response writer
- * @param env pointer to environment struct
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
- axis2_status_t (AXIS2_CALL *
- println)(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env);
-
- /**
- * @param response_writer pointer to response writer
- * @param env pointer to environment struct
- * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
- */
- void (AXIS2_CALL *
- free)(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env);
- };
-
- /**
- * axis2 http response writer
- */
- struct axis2_http_response_writer
- {
- /** operations of axis2 http response writer */
- axis2_http_response_writer_ops_t *ops;
- };
+ AXIS2_EXTERN axis2_status_t AXIS2_CALL
+ axis2_http_response_writer_write_char(axis2_http_response_writer_t *response_writer,
+ const axis2_env_t *env,
+ char c);
+ /**
+ * @param response_writer pointer to response writer
+ * @param env pointer to environment struct
+ * @param buf pointer to buf
+ * @param offset
+ * @param len
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+ */
+ AXIS2_EXTERN axis2_status_t AXIS2_CALL
+ axis2_http_response_writer_write_buf(axis2_http_response_writer_t *response_writer,
+ const axis2_env_t *env,
+ char *buf,
+ int offset,
+ axis2_ssize_t len);
+
+ /**
+ * @param response_writer pointer to response writer
+ * @param env pointer to environment struct
+ * @param str pointer to str
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+ */
+ AXIS2_EXTERN axis2_status_t AXIS2_CALL
+ axis2_http_response_writer_print_str(axis2_http_response_writer_t *response_writer,
+ const axis2_env_t *env,
+ const char *str);
+
+ /**
+ * @param response_writer pointer to response writer
+ * @param env pointer to environment struct
+ * @param i
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+ */
+ AXIS2_EXTERN axis2_status_t AXIS2_CALL
+ axis2_http_response_writer_print_int(axis2_http_response_writer_t *response_writer,
+ const axis2_env_t *env,
+ int i);
+
+ /**
+ * @param response_writer pointer to response writer
+ * @param env pointer to environment struct
+ * @param str pointer to str
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+ */
+ AXIS2_EXTERN axis2_status_t AXIS2_CALL
+ axis2_http_response_writer_println_str(axis2_http_response_writer_t *response_writer,
+ const axis2_env_t *env,
+ const char *str);
+
+ /**
+ * @param response_writer pointer to response writer
+ * @param env pointer to environment struct
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+ */
+ AXIS2_EXTERN axis2_status_t AXIS2_CALL
+ axis2_http_response_writer_println(axis2_http_response_writer_t *response_writer,
+ const axis2_env_t *env);
+
+ /**
+ * @param response_writer pointer to response writer
+ * @param env pointer to environment struct
+ * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+ */
+ AXIS2_EXTERN void AXIS2_CALL
+ axis2_http_response_writer_free(axis2_http_response_writer_t *response_writer,
+ const axis2_env_t *env);
/**
* @param env pointer to environment struct
@@ -195,61 +166,57 @@
axis2_stream_t *stream,
const axis2_char_t *encoding);
-/************************** Start of function macros **************************/
-
/** Get encoding.
@sa axis2_http_response_writer_ops#get_encoding */
#define AXIS2_HTTP_RESPONSE_WRITER_GET_ENCODING(response_writer, env) \
- ((response_writer)->ops->get_encoding(response_writer, env))
+ axis2_http_response_writer_get_encoding(response_writer, env)
/** Close.
@sa axis2_http_response_writer_ops#close */
#define AXIS2_HTTP_RESPONSE_WRITER_CLOSE(response_writer, env) \
- ((response_writer)->ops->close(response_writer, env))
+ axis2_http_response_writer_close(response_writer, env)
/** Flush.
@sa axis2_http_response_writer_ops#flush */
#define AXIS2_HTTP_RESPONSE_WRITER_FLUSH(response_writer, env) \
- ((response_writer)->ops->flush(response_writer, env))
+ axis2_http_response_writer_flush(response_writer, env)
/** Write char.
@sa axis2_http_response_writer_ops#write_char */
#define AXIS2_HTTP_RESPONSE_WRITER_WRITE_CHAR(response_writer, env, c) \
- ((response_writer)->ops->write_char(response_writer, env, c))
+ axis2_http_response_writer_write_char(response_writer, env, c)
/** Write buf.
@sa axis2_http_response_writer_ops#write_buf */
#define AXIS2_HTTP_RESPONSE_WRITER_WRITE_BUF(response_writer, env, buf, offset,\
- len) ((response_writer)->ops->write_buf(response_writer, \
- env, buf, offset, len))
+ len) axis2_http_response_writer_write_buf(response_writer, \
+ env, buf, offset, len)
/** Print str.
@sa axis2_http_response_writer_ops#print_str */
#define AXIS2_HTTP_RESPONSE_WRITER_PRINT_STR(response_writer, env, str) \
- ((response_writer)->ops->print_str(response_writer, env, str))
+ axis2_http_response_writer_print_str(response_writer, env, str)
/** Print int.
@sa axis2_http_response_writer_ops#print_int */
#define AXIS2_HTTP_RESPONSE_WRITER_PRINT_INT(response_writer, env, i)\
- ((response_writer)->ops->print_int(response_writer, env))
+ axis2_http_response_writer_print_int(response_writer, env)
/** Println str.
@sa axis2_http_response_writer_ops#println_str */
#define AXIS2_HTTP_RESPONSE_WRITER_PRINTLN_STR(response_writer, env, str) \
- ((response_writer)->ops->println_str(response_writer, env,\
- str))
+ axis2_http_response_writer_println_str(response_writer, env,\
+ str)
/** Println.
@sa axis2_http_response_writer_ops#println */
#define AXIS2_HTTP_RESPONSE_WRITER_PRINTLN(response_writer, env) \
- ((response_writer)->ops->println(response_writer, env))
+ axis2_http_response_writer_println(response_writer, env)
/** Frees the http response writer.
@sa axis2_http_response_writer_ops#free */
#define AXIS2_HTTP_RESPONSE_WRITER_FREE(response_writer, env)\
- ((response_writer)->ops->free(response_writer, env))
-
-/************************** End of function macros ****************************/
+ axis2_http_response_writer_free(response_writer, env)
/** @} */
#ifdef __cplusplus
Modified: webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_response_writer.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_response_writer.c?view=diff&rev=523972&r1=523971&r2=523972
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_response_writer.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/receiver/http_response_writer.c Fri Mar 30 00:20:01 2007
@@ -20,82 +20,13 @@
#include <axis2_http_transport.h>
#include <axis2_string.h>
-/**
- * @brief HTTP Response Writer struct impl
- * Axis2 HTTP Response Writer impl
- */
-
-typedef struct axis2_http_response_writer_impl
+struct axis2_http_response_writer
{
- axis2_http_response_writer_t response_writer;
axis2_stream_t *stream;
axis2_char_t *encoding;
-}
-axis2_http_response_writer_impl_t;
-
-#define AXIS2_INTF_TO_IMPL(response_writer) \
- ((axis2_http_response_writer_impl_t *)(response_writer))
-
-/***************************** Function headers *******************************/
-
-axis2_char_t *AXIS2_CALL
-axis2_http_response_writer_get_encoding(
- const axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_http_response_writer_close(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_http_response_writer_flush(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env);
-
-axis2_status_t AXIS2_CALL
-axis2_http_response_writer_write_char(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env,
- char c);
-
-axis2_status_t AXIS2_CALL
-axis2_http_response_writer_write_buf(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env,
- char *buf,
- int offset,
- axis2_ssize_t len);
+};
-axis2_status_t AXIS2_CALL
-axis2_http_response_writer_print_str(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env,
- const char *str);
-
-axis2_status_t AXIS2_CALL
-axis2_http_response_writer_print_int(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env,
- int i);
-
-axis2_status_t AXIS2_CALL
-axis2_http_response_writer_println_str(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env,
- const char *str);
-
-axis2_status_t AXIS2_CALL
-axis2_http_response_writer_println(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env);
-
-void AXIS2_CALL
-axis2_http_response_writer_free(
- axis2_http_response_writer_t *response_writer,
- const axis2_env_t *env);
-
-axis2_http_response_writer_t *AXIS2_CALL
+AXIS2_EXTERN axis2_http_response_writer_t *AXIS2_CALL
axis2_http_response_writer_create(
const axis2_env_t *env,
axis2_stream_t *stream)
@@ -106,91 +37,57 @@
}
-axis2_http_response_writer_t *AXIS2_CALL
+AXIS2_EXTERN axis2_http_response_writer_t *AXIS2_CALL
axis2_http_response_writer_create_with_encoding(
const axis2_env_t *env,
axis2_stream_t *stream,
const axis2_char_t *encoding)
{
- axis2_http_response_writer_impl_t *response_writer_impl = NULL;
+ axis2_http_response_writer_t *response_writer = NULL;
AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, encoding, NULL);
- response_writer_impl = (axis2_http_response_writer_impl_t *)AXIS2_MALLOC
+ response_writer = (axis2_http_response_writer_t *)AXIS2_MALLOC
(env->allocator, sizeof(
- axis2_http_response_writer_impl_t));
+ axis2_http_response_writer_t));
- if (! response_writer_impl)
+ if (! response_writer)
{
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
- response_writer_impl->stream = stream;
- response_writer_impl->encoding = (axis2_char_t *)axis2_strdup(env, encoding);
+ response_writer->stream = stream;
+ response_writer->encoding = (axis2_char_t *)axis2_strdup(env, encoding);
- response_writer_impl->response_writer.ops = AXIS2_MALLOC(env->allocator,
- sizeof(axis2_http_response_writer_ops_t));
- if (! response_writer_impl->response_writer.ops)
- {
- axis2_http_response_writer_free((axis2_http_response_writer_t *)
- response_writer_impl, env);
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
-
- response_writer_impl->response_writer.ops->get_encoding =
- axis2_http_response_writer_get_encoding;
- response_writer_impl->response_writer.ops->close =
- axis2_http_response_writer_close;
- response_writer_impl->response_writer.ops->flush =
- axis2_http_response_writer_flush;
- response_writer_impl->response_writer.ops->write_char =
- axis2_http_response_writer_write_char;
- response_writer_impl->response_writer.ops->write_buf =
- axis2_http_response_writer_write_buf;
- response_writer_impl->response_writer.ops->print_str =
- axis2_http_response_writer_print_str;
- response_writer_impl->response_writer.ops->print_int =
- axis2_http_response_writer_print_int;
- response_writer_impl->response_writer.ops->println_str =
- axis2_http_response_writer_println_str;
- response_writer_impl->response_writer.ops->println =
- axis2_http_response_writer_println;
- response_writer_impl->response_writer.ops->free =
- axis2_http_response_writer_free;
-
- return &(response_writer_impl->response_writer);
+ return response_writer;
}
-void AXIS2_CALL
+AXIS2_EXTERN void AXIS2_CALL
axis2_http_response_writer_free(
axis2_http_response_writer_t *response_writer,
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_FREE(env->allocator,
- AXIS2_INTF_TO_IMPL(response_writer)->encoding);
-
- if (response_writer->ops)
- AXIS2_FREE(env->allocator, response_writer->ops);
+ response_writer->encoding);
- AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(response_writer));
+ AXIS2_FREE(env->allocator, response_writer);
return;
}
-axis2_char_t *AXIS2_CALL
+AXIS2_EXTERN axis2_char_t *AXIS2_CALL
axis2_http_response_writer_get_encoding(
const axis2_http_response_writer_t *response_writer,
const axis2_env_t *env)
{
AXIS2_ENV_CHECK(env, NULL);
- return AXIS2_INTF_TO_IMPL(response_writer)->encoding;
+ return response_writer->encoding;
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_http_response_writer_close(
axis2_http_response_writer_t *response_writer,
const axis2_env_t *env)
@@ -200,7 +97,7 @@
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_http_response_writer_flush(
axis2_http_response_writer_t *response_writer,
const axis2_env_t *env)
@@ -213,22 +110,20 @@
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_http_response_writer_write_char(
axis2_http_response_writer_t *response_writer,
const axis2_env_t *env,
char c)
{
- axis2_http_response_writer_impl_t *writer_impl = NULL;
int write = -1;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- writer_impl = AXIS2_INTF_TO_IMPL(response_writer);
- if (! writer_impl->stream)
+ if (! response_writer->stream)
{
return AXIS2_FAILURE;
}
- write = AXIS2_STREAM_WRITE(writer_impl->stream, env, &c, 1);
+ write = AXIS2_STREAM_WRITE(response_writer->stream, env, &c, 1);
if (write < 0)
{
return AXIS2_FAILURE;
@@ -237,7 +132,7 @@
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_http_response_writer_write_buf(
axis2_http_response_writer_t *response_writer,
const axis2_env_t *env,
@@ -245,17 +140,15 @@
int offset,
axis2_ssize_t len)
{
- axis2_http_response_writer_impl_t *writer_impl = NULL;
int write = -1;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, buf, AXIS2_FAILURE);
- writer_impl = AXIS2_INTF_TO_IMPL(response_writer);
- if (! writer_impl->stream)
+ if (! response_writer->stream)
{
return AXIS2_FAILURE;
}
- write = AXIS2_STREAM_WRITE(writer_impl->stream, env, buf, len);
+ write = AXIS2_STREAM_WRITE(response_writer->stream, env, buf, len);
if (write < 0)
{
return AXIS2_FAILURE;
@@ -267,26 +160,24 @@
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_http_response_writer_print_str(
axis2_http_response_writer_t *response_writer,
const axis2_env_t *env,
const char *str)
{
- axis2_http_response_writer_impl_t *writer_impl = NULL;
int write = -1;
int len = -1;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, str, AXIS2_FAILURE);
- writer_impl = AXIS2_INTF_TO_IMPL(response_writer);
len = axis2_strlen(str);
- if (! writer_impl->stream)
+ if (! response_writer->stream)
{
return AXIS2_FAILURE;
}
- write = AXIS2_STREAM_WRITE(writer_impl->stream, env, str, len);
+ write = AXIS2_STREAM_WRITE(response_writer->stream, env, str, len);
if (write < 0)
{
return AXIS2_FAILURE;
@@ -295,7 +186,7 @@
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_http_response_writer_print_int(
axis2_http_response_writer_t *response_writer,
const axis2_env_t *env,
@@ -308,7 +199,7 @@
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_http_response_writer_println_str(
axis2_http_response_writer_t *response_writer,
const axis2_env_t *env,
@@ -327,7 +218,7 @@
}
-axis2_status_t AXIS2_CALL
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
axis2_http_response_writer_println(
axis2_http_response_writer_t *response_writer,
const axis2_env_t *env)
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org