00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef AXIS2_STACK_H
00018 #define AXIS2_STACK_H
00019
00020
00026 #include <axis2_utils_defines.h>
00027 #include <axis2_env.h>
00028
00029 #ifdef __cplusplus
00030 extern "C"
00031 {
00032 #endif
00033
00034 typedef struct axis2_stack_ops axis2_stack_ops_t;
00035 typedef struct axis2_stack axis2_stack_t;
00036
00048 AXIS2_DECLARE_DATA struct axis2_stack_ops
00049 {
00056 axis2_status_t (AXIS2_CALL*
00057 free)(axis2_stack_t *stack,
00058 const axis2_env_t *env);
00059
00060 void* (AXIS2_CALL*
00061 pop)(axis2_stack_t *stack,
00062 const axis2_env_t *env);
00063
00064 axis2_status_t (AXIS2_CALL *
00065 push)(axis2_stack_t *stack,
00066 const axis2_env_t *env,
00067 void* value);
00068
00069 int (AXIS2_CALL *
00070 size)(axis2_stack_t *stack,
00071 const axis2_env_t *env);
00077 void* (AXIS2_CALL *
00078 get)(axis2_stack_t *stack,
00079 const axis2_env_t *env);
00080
00081 void* (AXIS2_CALL *
00082 get_at)(axis2_stack_t *stack,
00083 const axis2_env_t *env,
00084 int i);
00085
00086
00087 };
00088
00089 struct axis2_stack
00090 {
00091 axis2_stack_ops_t *ops;
00092 };
00093
00094 AXIS2_EXTERN axis2_stack_t * AXIS2_CALL
00095 axis2_stack_create(const axis2_env_t *env);
00096
00097
00098
00099
00100 #define AXIS2_STACK_FREE( stack, env) \
00101 ((stack)->ops->free( stack, env))
00102
00103 #define AXIS2_STACK_POP( stack, env) \
00104 ((stack)->ops->pop( stack, env))
00105
00106 #define AXIS2_STACK_PUSH( stack, env, value) \
00107 ((stack)->ops->push( stack, env, value))
00108
00109 #define AXIS2_STACK_SIZE( stack, env) \
00110 ((stack)->ops->size( stack, env))
00111
00112 #define AXIS2_STACK_GET( stack, env) \
00113 ((stack)->ops->get( stack, env))
00114
00115 #define AXIS2_STACK_GET_AT( stack, env, i) \
00116 ((stack)->ops->get_at( stack, env, i))
00117
00118
00121 #ifdef __cplusplus
00122 }
00123 #endif
00124 #endif
00125