aboutsummaryrefslogtreecommitdiff
path: root/include/argot/list.h
blob: 8293fc65d7d0800f2c5c0ea52e470e5634b03820 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* argot - Gray's Extensible Configuration System -*- c -*-
   Copyright (C) 2007-2016 Sergey Poznyakoff

   Grecs is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
   Free Software Foundation; either version 3 of the License, or (at your
   option) any later version.

   Grecs is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License along
   with Grecs. If not, see <http://www.gnu.org/licenses/>. */

#ifndef _ARGOT_LIST_H
#define _ARGOT_LIST_H

typedef struct argot_list_entry *argot_list_entry_ptr_t;
typedef struct argot_list *argot_list_ptr_t;

struct argot_list_entry {
	struct argot_list_entry *next, *prev;
	void *data;
};

struct argot_list {
	struct argot_list_entry *head, *tail;
	size_t count;
	int (*cmp)(const void *, const void *);
	void (*free_entry)(void *);
};

argot_list_ptr_t argot_list_create(void);
size_t argot_list_size(argot_list_ptr_t);
void argot_list_append(argot_list_ptr_t, void *);
void argot_list_push(argot_list_ptr_t, void *);
void *argot_list_pop(argot_list_ptr_t);
void *argot_list_locate(argot_list_ptr_t, void *);
void *argot_list_index(argot_list_ptr_t, size_t);
void *argot_list_remove_tail(argot_list_ptr_t);
void argot_list_remove_entry(argot_list_ptr_t, argot_list_entry_ptr_t);
void argot_list_clear(argot_list_ptr_t);
void argot_list_free(argot_list_ptr_t);
void argot_list_add(argot_list_ptr_t, argot_list_ptr_t);
int argot_list_compare(argot_list_ptr_t, argot_list_ptr_t);

/* FIXME */
struct argot_list *_argot_simple_list_create(int dispose);
struct argot_list *argot_value_list_create(void);


#endif

Return to:

Send suggestions and report system problems to the System administrator.