From 42817756b603d2dc76c1408d0a6f432673350bd7 Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Sun, 3 Feb 2008 19:20:42 +0000 Subject: * Added an iterator to map.h/c. Will be used instead of map_getallusers, which has problems with dangling pointers (returned array isn't updated). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12170 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/common/db.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/common/db.h') diff --git a/src/common/db.h b/src/common/db.h index cf9e4e82e..eb6318869 100644 --- a/src/common/db.h +++ b/src/common/db.h @@ -608,6 +608,14 @@ struct DBMap { #define strdb_alloc(opt,maxlen) db_alloc(__FILE__,__LINE__,DB_STRING,(opt),(maxlen)) #define stridb_alloc(opt,maxlen) db_alloc(__FILE__,__LINE__,DB_ISTRING,(opt),(maxlen)) #define db_destroy(db) ( (db)->destroy((db),NULL) ) +// Other macros +#define db_iterator(db) ( (db)->iterator(db) ) +#define dbi_first(dbi) ( (dbi)->first(dbi,NULL) ) +#define dbi_last(dbi) ( (dbi)->last(dbi,NULL) ) +#define dbi_next(dbi) ( (dbi)->next(dbi,NULL) ) +#define dbi_prev(dbi) ( (dbi)->prev(dbi,NULL) ) +#define dbi_exists(dbi) ( (dbi)->exists(dbi) ) +#define dbi_destroy(dbi) ( (dbi)->destroy(dbi) ) /*****************************************************************************\ * (2) Section with public functions. * -- cgit v1.2.3-60-g2f50