libcollection  0.2.91
 All Data Structures Functions Typedefs Groups Pages
collection_queue.h
1 /*
2  QUEUE
3 
4  Header file for queue 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_QUEUE_H
23 #define COLLECTION_QUEUE_H
24 
25 #include "collection.h"
26 
37 #define COL_CLASS_QUEUE 40000
38 
39 #define COL_NAME_QUEUE "queue"
40 
52 int col_create_queue(struct collection_item **queue);
53 
62 void col_destroy_queue(struct collection_item *queue);
63 
97  const char *property,
98  const char *string,
99  int length);
122  const char *property,
123  void *binary_data,
124  int length);
145 int col_enqueue_int_property(struct collection_item *queue,
146  const char *property,
147  int32_t number);
169  const char *property,
170  uint32_t number);
192  const char *property,
193  int64_t number);
215  const char *property,
216  uint64_t number);
238  const char *property,
239  double number);
261  const char *property,
262  unsigned char logical);
263 
287 int col_enqueue_any_property(struct collection_item *queue,
288  const char *property,
289  int type,
290  void *data,
291  int length);
292 
303 int col_enqueue_item(struct collection_item *queue,
304  struct collection_item *item);
305 
319 int col_dequeue_item(struct collection_item *queue,
320  struct collection_item **item);
321 
326 #endif