summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-02-03 19:20:42 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-02-03 19:20:42 +0000
commit42817756b603d2dc76c1408d0a6f432673350bd7 (patch)
treeb9e0780f47c550e7bce922bc84de0941beee9a93 /src/common
parentf010f32adb51f7d4d2648abd475a900ecf07bafa (diff)
downloadhercules-42817756b603d2dc76c1408d0a6f432673350bd7.tar.gz
hercules-42817756b603d2dc76c1408d0a6f432673350bd7.tar.bz2
hercules-42817756b603d2dc76c1408d0a6f432673350bd7.tar.xz
hercules-42817756b603d2dc76c1408d0a6f432673350bd7.zip
* 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
Diffstat (limited to 'src/common')
-rw-r--r--src/common/db.h8
1 files changed, 8 insertions, 0 deletions
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. *