guththila_stack.h

00001 
00002 /*
00003  * Licensed to the Apache Software Foundation (ASF) under one or more
00004  * contributor license agreements.  See the NOTICE file distributed with
00005  * this work for additional information regarding copyright ownership.
00006  * The ASF licenses this file to You under the Apache License, Version 2.0
00007  * (the "License"); you may not use this file except in compliance with
00008  * the License.  You may obtain a copy of the License at
00009  *
00010  *      http://www.apache.org/licenses/LICENSE-2.0
00011  *
00012  * Unless required by applicable law or agreed to in writing, software
00013  * distributed under the License is distributed on an "AS IS" BASIS,
00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  * See the License for the specific language governing permissions and
00016  * limitations under the License.
00017  */
00018 #ifndef GUTHTHILA_STACK_H
00019 #define GUTHTHILA_STACK_H
00020 
00021 #include <stdio.h>
00022 #include <stdlib.h>
00023 
00024 #include <guththila_defines.h>
00025 #include <axutil_utils.h>
00026 #define GUTHTHILA_STACK_DEFAULT 16
00027 EXTERN_C_START() typedef struct guththila_stack_s
00028 {
00029 
00030     /* Number of Items in the stack */
00031     int
00032     top;
00033 
00034     /* Max number of Items that can be hold in data */
00035     int
00036     max;
00037     void **
00038     data;
00039     
00040 }
00041 guththila_stack_t;
00042 
00043 #ifndef GUTHTHILA_STACK_SIZE
00044 #define GUTHTHILA_STACK_SIZE(_stack) ((_stack).top)
00045 #endif  /*  */
00046 
00047 #ifndef GUTHTHILA_STACK_TOP_INDEX
00048 #define GUTHTHILA_STACK_TOP_INDEX(_stack) (((_stack).top - 1))
00049 #endif  /*  */
00050 int GUTHTHILA_CALL
00051 guththila_stack_init(
00052     guththila_stack_t * stack,
00053     const axutil_env_t * env);
00054 void GUTHTHILA_CALL
00055 guththila_stack_free(
00056     guththila_stack_t * stack,
00057     const axutil_env_t * env);
00058 void GUTHTHILA_CALL
00059 guththila_stack_un_init(
00060     guththila_stack_t * stack,
00061     const axutil_env_t * env);
00062 void *
00063 GUTHTHILA_CALL
00064 guththila_stack_pop(
00065     guththila_stack_t * stack,
00066     const axutil_env_t * env);
00067 int GUTHTHILA_CALL
00068 guththila_stack_push(
00069     guththila_stack_t * stack,
00070     void *data,
00071     const axutil_env_t * env);
00072 void *
00073 GUTHTHILA_CALL
00074 guththila_stack_peek(
00075     guththila_stack_t * stack,
00076     const axutil_env_t * env);
00077 void *
00078 GUTHTHILA_CALL
00079 guththila_stack_get_by_index(
00080     guththila_stack_t * stack,
00081     int index,
00082     const axutil_env_t * env);
00083 int GUTHTHILA_CALL
00084 guththila_stack_del_top(
00085     guththila_stack_t * stack,
00086     const axutil_env_t * env);
00087 int GUTHTHILA_CALL
00088 guththila_stack_is_empty(
00089     guththila_stack_t * stack,
00090     const axutil_env_t * env);
00091 EXTERN_C_END() 
00092 #endif  /*  */
00093 

Generated on Sat May 3 10:44:35 2008 for Axis2/C by  doxygen 1.5.5