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