libcollection  0.5.0
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
int col_create_queue(struct collection_item **queue)
Create queue.
Definition: collection_queue.c:29
int col_enqueue_any_property(struct collection_item *queue, const char *property, int type, void *data, int length)
Add value of any type to the queue.
Definition: collection_queue.c:273
int col_enqueue_unsigned_property(struct collection_item *queue, const char *property, uint32_t number)
Add unsigned value to the queue.
Definition: collection_queue.c:137
int col_enqueue_ulong_property(struct collection_item *queue, const char *property, uint64_t number)
Add unsigned long value to the queue.
Definition: collection_queue.c:192
int col_enqueue_double_property(struct collection_item *queue, const char *property, double number)
Add floating point value to the queue.
Definition: collection_queue.c:219
int col_dequeue_item(struct collection_item *queue, struct collection_item **item)
Get item from the queue.
Definition: collection_queue.c:333
int col_enqueue_str_property(struct collection_item *queue, const char *property, const char *string, int length)
Add string to the queue.
Definition: collection_queue.c:53
int col_enqueue_binary_property(struct collection_item *queue, const char *property, void *binary_data, int length)
Add binary value to the queue.
Definition: collection_queue.c:81
Opaque structure that holds one property.
int col_enqueue_long_property(struct collection_item *queue, const char *property, int64_t number)
Add long integer value to the queue.
Definition: collection_queue.c:165
void col_destroy_queue(struct collection_item *queue)
Destroy queue.
Definition: collection_queue.c:42
int col_enqueue_int_property(struct collection_item *queue, const char *property, int32_t number)
Add integer value to the queue.
Definition: collection_queue.c:110
int col_enqueue_item(struct collection_item *queue, struct collection_item *item)
Push item into the queue.
Definition: collection_queue.c:302
int col_enqueue_bool_property(struct collection_item *queue, const char *property, unsigned char logical)
Add Boolean value to the queue.
Definition: collection_queue.c:246