libcollection  0.6.0
collection_stack.h
1 /*
2  STACK
3 
4  Header file for stack implemented using collection interface.
5 
6  Copyright (C) Dmitri Pal <dpal@redhat.com> 2009
7 
8  Collection Library is free software: you can redistribute it and/or modify
9  it under the terms of the GNU Lesser General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  Collection Library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License
19  along with Collection Library. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 #ifndef COLLECTION_STACK_H
23 #define COLLECTION_STACK_H
24 
25 #include <collection.h>
26 
37 #define COL_CLASS_STACK 30000
38 
39 #define COL_NAME_STACK "stack"
40 
52 int col_create_stack(struct collection_item **stack);
53 
63 void col_destroy_stack(struct collection_item *stack);
64 
97 int col_push_str_property(struct collection_item *stack,
98  const char *property,
99  const char *string,
100  int length);
122 int col_push_binary_property(struct collection_item *stack,
123  const char *property,
124  void *binary_data,
125  int length);
146 int col_push_int_property(struct collection_item *stack,
147  const char *property,
148  int32_t number);
170  const char *property,
171  uint32_t number);
192 int col_push_long_property(struct collection_item *stack,
193  const char *property,
194  int64_t number);
215 int col_push_ulong_property(struct collection_item *stack,
216  const char *property,
217  uint64_t number);
238 int col_push_double_property(struct collection_item *stack,
239  const char *property,
240  double number);
261 int col_push_bool_property(struct collection_item *stack,
262  const char *property,
263  unsigned char logical);
264 
288 int col_push_any_property(struct collection_item *stack,
289  const char *property,
290  int type,
291  void *data,
292  int length);
293 
305 int col_push_item(struct collection_item *stack,
306  struct collection_item *item);
307 
308 
322 int col_pop_item(struct collection_item *stack,
323  struct collection_item **item);
324 
328 #endif
int col_push_item(struct collection_item *stack, struct collection_item *item)
Push item into the stack.
Definition: collection_stack.c:300
int col_push_binary_property(struct collection_item *stack, const char *property, void *binary_data, int length)
Push binary value to the stack.
Definition: collection_stack.c:79
int col_push_int_property(struct collection_item *stack, const char *property, int32_t number)
Push integer value to the stack.
Definition: collection_stack.c:108
int col_push_double_property(struct collection_item *stack, const char *property, double number)
Push floating point value to the stack.
Definition: collection_stack.c:217
void col_destroy_stack(struct collection_item *stack)
Destroy stack.
Definition: collection_stack.c:42
int col_push_bool_property(struct collection_item *stack, const char *property, unsigned char logical)
Push Boolean value to the stack.
Definition: collection_stack.c:244
int col_pop_item(struct collection_item *stack, struct collection_item **item)
Pop item from the stack.
Definition: collection_stack.c:331
int col_push_str_property(struct collection_item *stack, const char *property, const char *string, int length)
Push string to the stack.
Definition: collection_stack.c:53
int col_create_stack(struct collection_item **stack)
Create stack.
Definition: collection_stack.c:29
int col_push_ulong_property(struct collection_item *stack, const char *property, uint64_t number)
Push unsigned long value to the stack.
Definition: collection_stack.c:190
int col_push_unsigned_property(struct collection_item *stack, const char *property, uint32_t number)
Push unsigned value to the stack.
Definition: collection_stack.c:135
Opaque structure that holds one property.
int col_push_any_property(struct collection_item *stack, const char *property, int type, void *data, int length)
Push value of any type to the stack.
Definition: collection_stack.c:271
int col_push_long_property(struct collection_item *stack, const char *property, int64_t number)
Push long integer value to the stack.
Definition: collection_stack.c:163