libcollection
0.1.3
|
00001 /* 00002 STACK 00003 00004 Header file for stack implemented using collection interface. 00005 00006 Copyright (C) Dmitri Pal <dpal@redhat.com> 2009 00007 00008 Collection Library is free software: you can redistribute it and/or modify 00009 it under the terms of the GNU Lesser General Public License as published by 00010 the Free Software Foundation, either version 3 of the License, or 00011 (at your option) any later version. 00012 00013 Collection Library is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU Lesser General Public License for more details. 00017 00018 You should have received a copy of the GNU Lesser General Public License 00019 along with Collection Library. If not, see <http://www.gnu.org/licenses/>. 00020 */ 00021 00022 #ifndef COLLECTION_STACK_H 00023 #define COLLECTION_STACK_H 00024 00025 #include <collection.h> 00026 00037 #define COL_CLASS_STACK 30000 00038 00039 #define COL_NAME_STACK "stack" 00040 00052 int col_create_stack(struct collection_item **stack); 00053 00063 void col_destroy_stack(struct collection_item *stack); 00064 00097 int col_push_str_property(struct collection_item *stack, 00098 const char *property, 00099 const char *string, 00100 int length); 00122 int col_push_binary_property(struct collection_item *stack, 00123 const char *property, 00124 void *binary_data, 00125 int length); 00146 int col_push_int_property(struct collection_item *stack, 00147 const char *property, 00148 int32_t number); 00169 int col_push_unsigned_property(struct collection_item *stack, 00170 const char *property, 00171 uint32_t number); 00192 int col_push_long_property(struct collection_item *stack, 00193 const char *property, 00194 int64_t number); 00215 int col_push_ulong_property(struct collection_item *stack, 00216 const char *property, 00217 uint64_t number); 00238 int col_push_double_property(struct collection_item *stack, 00239 const char *property, 00240 double number); 00261 int col_push_bool_property(struct collection_item *stack, 00262 const char *property, 00263 unsigned char logical); 00264 00288 int col_push_any_property(struct collection_item *stack, 00289 const char *property, 00290 int type, 00291 void *data, 00292 int length); 00293 00305 int col_push_item(struct collection_item *stack, 00306 struct collection_item *item); 00307 00308 00322 int col_pop_item(struct collection_item *stack, 00323 struct collection_item **item); 00324 00325 #endif