You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2005/10/10 12:20:47 UTC
svn commit: r312603 - in /webservices/axis2/trunk/c/include: axis2.h
axis2_allocator.h axis2_defines.h axis2_environment.h axis2_error.h
axis2_om_node.h axis2_stream.h
Author: samisa
Date: Mon Oct 10 03:20:31 2005
New Revision: 312603
URL: http://svn.apache.org/viewcvs?rev=312603&view=rev
Log:
Added the environment and the related allocator, error and stream to help make the implemetation more portable
Added:
webservices/axis2/trunk/c/include/axis2_allocator.h
webservices/axis2/trunk/c/include/axis2_defines.h
webservices/axis2/trunk/c/include/axis2_environment.h
webservices/axis2/trunk/c/include/axis2_error.h
webservices/axis2/trunk/c/include/axis2_stream.h
Modified:
webservices/axis2/trunk/c/include/axis2.h
webservices/axis2/trunk/c/include/axis2_om_node.h
Modified: webservices/axis2/trunk/c/include/axis2.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2.h?rev=312603&r1=312602&r2=312603&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2.h (original)
+++ webservices/axis2/trunk/c/include/axis2.h Mon Oct 10 03:20:31 2005
@@ -21,4 +21,5 @@
apr_hash_t *axis2_apr_hash_make(apr_pool_t *om_pool);
+
#endif /* AXIS2_H */
Added: webservices/axis2/trunk/c/include/axis2_allocator.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_allocator.h?rev=312603&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_allocator.h (added)
+++ webservices/axis2/trunk/c/include/axis2_allocator.h Mon Oct 10 03:20:31 2005
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_MEMORY_ALLOCATOR_H
+#define AXIS2_MEMORY_ALLOCATOR_H
+
+#include <stdlib.h>
+#include <axis2_defines.h>
+
+typedef struct
+{
+ void *(*malloc)(size_t size);
+ void *(*realloc)(void *ptr,size_t size);
+ void (*free)(void *ptr);
+}axis2_allocator_t;
+
+/**
+* if the parsed allocator is null a default allocator is created
+* otherwise the parsed allocator is returned. If there isn't enough
+* memory for allocation NULL is returned.
+* @param allocator user defined allcator
+*/
+
+axis2_allocator_t *
+ axis2_allocator_init(axis2_allocator_t *allocator);
+
+#define axis2_malloc(allocator, size) ((allocator)->malloc(size))
+#define axis2_realloc(allocator, ptr, size) ((allocator)->realloc(ptr, size))
+#define axis2_free(allocator, ptr) ((allocator)->free(ptr))
+
+#endif /* AXIS2_MEMORY_ALLOCATOR_H */
Added: webservices/axis2/trunk/c/include/axis2_defines.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_defines.h?rev=312603&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_defines.h (added)
+++ webservices/axis2/trunk/c/include/axis2_defines.h Mon Oct 10 03:20:31 2005
@@ -0,0 +1,11 @@
+#ifndef AXIS2_H
+#define AXIS2_H
+
+/**
+ * @file axis2.h
+ * @brief Axis2c specific global declarations
+ */
+
+typedef char axis2_char;
+
+#endif /* AXIS2_H */
Added: webservices/axis2/trunk/c/include/axis2_environment.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_environment.h?rev=312603&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_environment.h (added)
+++ webservices/axis2/trunk/c/include/axis2_environment.h Mon Oct 10 03:20:31 2005
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_ENVIRONMENT_H
+#define AXIS2_ENVIRONMENT_H
+
+#include <axis2_allocator.h>
+#include <axis2_error.h>
+#include <axis2_stream.h>
+
+struct axis2_environment;
+struct axis2_environment_ops;
+
+typedef struct axis2_environment_ops {
+} axis2_environment_ops_t;
+
+typedef struct axis2_environment {
+ struct axis2_environment_ops *ops;
+ axis2_allocator_t *allocator;
+ axis2_error_t *error;
+ axis2_stream_t *stream;
+} axis2_environment_t;
+
+axis2_environment_t *axis2_environment_create(axis2_allocator_t *allocator, axis2_error_t *error, axis2_stream_t *stream);
+
+#endif /* AXIS2_ENVIRONMENT_H */
Added: webservices/axis2/trunk/c/include/axis2_error.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_error.h?rev=312603&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_error.h (added)
+++ webservices/axis2/trunk/c/include/axis2_error.h Mon Oct 10 03:20:31 2005
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_ERROR_H
+#define AXIS2_ERROR_H
+
+#include <axis2_allocator.h>
+
+struct axis2_error;
+struct axis2_error_ops;
+
+typedef struct axis2_error_ops {
+ axis2_char* (*get_message)();
+} axis2_error_ops_t;
+
+typedef struct axis2_error {
+ struct axis2_error_ops *ops;
+ int errorno;
+} axis2_error_t;
+
+axis2_error_t *axis2_error_create(axis2_allocator_t* allocator);
+
+#define axis2_error_get_message(error) ((error)->ops->get_message())
+
+typedef enum axis2_status_codes {
+ AXIS2_FAILURE = 0,
+ AXIS2_SUCCESS
+} axis2_status_codes_t;
+
+typedef enum axis2_error_codes {
+ AXIS2_ERROR_NONE = 0,
+ AXIS2_ERROR_NO_MEMORY
+} axis2_error_codes_t;
+
+
+#endif /* AXIS2_ERROR_H */
Modified: webservices/axis2/trunk/c/include/axis2_om_node.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_om_node.h?rev=312603&r1=312602&r2=312603&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_om_node.h (original)
+++ webservices/axis2/trunk/c/include/axis2_om_node.h Mon Oct 10 03:20:31 2005
@@ -57,7 +57,9 @@
* we keep pointers parent , previous sibling , next sibling ,
* first child and last child for constructing and navigating the tree
*
-*/
+*/
+
+
typedef struct axis2_om_node_t {
struct axis2_om_node_t *parent;
struct axis2_om_node_t *prev_sibling;
Added: webservices/axis2/trunk/c/include/axis2_stream.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_stream.h?rev=312603&view=auto
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_stream.h (added)
+++ webservices/axis2/trunk/c/include/axis2_stream.h Mon Oct 10 03:20:31 2005
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef AXIS2_STREAM_H
+#define AXIS2_STREAM_H
+
+#include <axis2_allocator.h>
+
+struct axis2_stream;
+struct axis2_stream_ops;
+
+typedef struct axis2_stream_ops {
+ int (*read)(void *buffer, size_t count);
+ int (*write)(const void *buffer, size_t count);
+} axis2_stream_ops_t;
+
+typedef struct axis2_stream {
+ struct axis2_stream_ops *ops;
+} axis2_stream_t;
+
+axis2_stream_t *axis2_stream_create(axis2_allocator_t* allocator, axis2_stream_ops_t* operations);
+
+#define axis2_stream_read(stream, a, b) ((stream)->ops->read(a, b))
+#define axis2_stream_write(stream, a, b) ((stream)->ops->write(a, b))
+
+#endif /* AXIS2_STREAM_H */