[6824] [2008_11_14_01_mangos_scripts.sql] Fixes in db_script_striong related code...
[auctionmangos.git] / dep / include / mysql / my_list.h
blob4a1737d4c538a17c3ef8a72703e4341db957eb34
1 /* Copyright (C) 2000 MySQL AB
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16 #ifndef _list_h_
17 #define _list_h_
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
23 typedef struct st_list {
24 struct st_list *prev,*next;
25 void *data;
26 } LIST;
28 typedef int (*list_walk_action)(void *,void *);
30 extern LIST *list_add(LIST *root,LIST *element);
31 extern LIST *list_delete(LIST *root,LIST *element);
32 extern LIST *list_cons(void *data,LIST *root);
33 extern LIST *list_reverse(LIST *root);
34 extern void list_free(LIST *root,unsigned int free_data);
35 extern unsigned int list_length(LIST *);
36 extern int list_walk(LIST *,list_walk_action action,gptr argument);
38 #define list_rest(a) ((a)->next)
39 #define list_push(a,b) (a)=list_cons((b),(a))
40 #define list_pop(A) {LIST *old=(A); (A)=list_delete(old,old) ; my_free((gptr) old,MYF(MY_FAE)); }
42 #ifdef __cplusplus
44 #endif
45 #endif