
DBMap
implementation to allow storing integer type data in addition to void pointers.
- Added enum for data: `int`, `unsigned int` and `void*` - Replaced generic `void*` data with `DBData` struct to hold `int`, `unsigned int` or `void*` (member of `DBNode`) - Added `db_i2data`, `db_ui2data` and `db_ptr2data` functions to cast from `int`/`uint`/`void*` to `DBData` (used in `DBMap::put()`) - Added `db_data2i`, `db_data2ui` and `db_data2ptr` functions to get `int`/`uint`/`void*` from `DBData` - Enabled statistics for new functions in `db_stats` struct - `DBCreateData` functions (used in `DBMap::ensure()`) now return `DBData` instead of `void*` - `DBApply` functions (used in `DBMap::foreach()` and `DBMap::destroy()`) now take `DBData*` as a parameter instead of `void*` - `DBMatcher` functions (used in `DBMap::getall()`) now take `DBData` as a parameter instead of `void*` - `DBReleaser` functions now take `DBData` as parameter instead of `void*` - Default releasers release data if it is `void*` (`DB_DATA_PTR`) type - `DBIterator` functions: `first()`, `last()`, `next()` and `prev()` now return `DBData*` instead of `void*` - `DBIterator::remove()` now returns `int` (1 if node was found and removed, 0 otherwise) instead of `void*` and takes an extra `DBData*` parameter for the data of removed entry - `DBMap::get()` and `DBMap::ensure()` now return `DBData*` instead of `void*` - `DBMap::remove()` and `DBMap::put()` now return `int` (1 if node already existed, 0 otherwise) instead of `void*` and take an extra `DBData*` parameter for the data of removed entry - `DBMap::put()` now takes `DBData` as parameter instead of `void*` - `DBMap::getall()` now puts data into `DBData**` buffer instead of `void**` buffer - Updated macros: - (`i`/`ui`/`str`)`db_get` and (`i`/`ui`/`str`)`db_ensure` were wrapped with `db_data2ptr` to extract data from `DBData*` that is now returned by `DBMap::get()` - added (`i`/`ui`/`str`)`db_iget` and (`i`/`ui`/`str`)`db_uiget` that get `DBData` from `DBMap` and extract `int`/`unsigned int` from it (with `db_data2i`/`db_data2ui`) - `db_put`, `idb_put`, `uidb_put` and `strdb_put` data params were wrapped with `db_ptr2data` to match new signature of `DBMap::put()` (`DBData` instead of `void*`) - added (`i`/`ui`/`str`)`db_iput` and (`i`/`ui`/`str`)`db_uiput` that put `int`/`unsigned int` into `DBMap` (first wrapping it with `DBData`) - added `NULL` in place of extra parameter for removed data in `db_remove` macros - `dbi_first`, `dbi_last`, `dbi_next` and `dbi_prev` were wrapped with `db_data2ptr` to extract data from `DBData*` that is now returned by these `DBIterator` functions - Updated `DBMap` documentation, and fixed a dozen of typos in it. - Updated rest of rA code to reflect `DBMap` changes (mostly required signature changes of `DBCreateData` and `DBApply` functions). - Fixed a bug where `DBMap::put()` would return data of a deleted entry. - Removed some unnecessary pointer casts. - Increased `showmsg.c` static buffer size to fit entire DBMap stats report. git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@15682 54d463be-8e91-2dee-dedb-b68131a5f0ec
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>RAthena | Intro</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <link rel="stylesheet" type="text/css" href="./readme/style.css"> </head> <body> <div id="template"> <div id="header"> <div class="logo">RAthena<br><span class="subtitle">- RAGNAROK Online Server Emulator</span></div> <div class="title">Intro</div> </div> <div id="navcontainer"> <ul id="navlist"> <li><a href="./readme.html">Intro</a></li> <li><a href="./readme/setup.html">Setup</a></li> <li><a href="./readme/faq.html">FAQ</a></li> <li><a href="./readme/scripting.html">Scripting</a></li> <li><a href="./readme/commands.html">GM Commands</a></li> <li><a href="./readme/resources.html">Resources</a></li> </ul> </div> <div class="body-container"> <ul> <li><span class="body-title">What is RAthena?</span><br> RAthena is a collaborative software development project revolving around the creation of a robust massively multiplayer online role playing game (MMORPG) server package. Written in C, the program is very versatile and provides NPCs, warps and modifications. The project is jointly managed by a group of volunteers located around the world as well as a tremendous community providing QA and support. RAthena is a continuation of the eAthena project. </li> </ul> <ul> <li><span class="body-title">Who are the RAthena developers?</span><br> You can find a list of the currently active RAthena developers at:<br> <a href="http://sourceforge.net/project/memberlist.php?group_id=637719" target="_new">http://sourceforge.net/project/memberlist.php?group_id=637719</a> </li> </ul> </div> <div id="footer">"Read Me" Created & Designed by <a href="http://www.kisuka.com" target="_new">Kisuka</a></div> </div> </body> </html>
Description
rAthena is an open-source cross-platform MMORPG server.
c-plus-pluseducationgame-developmentgame-serverhacktoberfestlearningmmorpgmmorpg-servermysqlragnarokrathenayaml
Readme
Languages
C++
98%
Perl
0.6%
CMake
0.4%
M4
0.3%
Makefile
0.2%
Other
0.2%