| 1 | /* |
| 2 | * Copyright (C) 2004 Dizzy |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; either version 2 |
| 7 | * of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 | */ |
| 18 | |
| 19 | #ifndef __ATTRGROUP_H_INCLUDED__ |
| 20 | #define __ATTRGROUP_H_INCLUDED__cxx . . $ `src/bnetd/attrgroup.h:20:9`! |
| 21 | |
| 22 | #include <ctime> |
| 23 | #include "common/elist.h"cxx . . $ `<file>/src/common/elist.h`/ |
| 24 | |
| 25 | #ifndef JUST_NEED_TYPEScxx . . $ `src/bnetd/channel_conv.h:27:9`! |
| 26 | #define JUST_NEED_TYPEScxx . . $ `src/bnetd/attrgroup.h:26:9`! |
| 27 | #include "storage.h"cxx . . $ `<file>/src/bnetd/storage.h`/ |
| 28 | #include <vector> |
| 29 | #undef JUST_NEED_TYPEScxx . . $ `src/bnetd/attrgroup.h:26:9`! |
| 30 | #else |
| 31 | #include "storage.h"cxx . . $ `<file>/src/bnetd/storage.h`/ |
| 32 | #endif |
| 33 | |
| 34 | #define ATTRGROUP_FLAG_NONEcxx . . $ `src/bnetd/attrgroup.h:34:9`! 0 |
| 35 | #define ATTRGROUP_FLAG_LOADEDcxx . . $ `src/bnetd/attrgroup.h:35:9`! 1 |
| 36 | #define ATTRGROUP_FLAG_ACCESSEDcxx . . $ `src/bnetd/attrgroup.h:36:9`! 2 |
| 37 | #define ATTRGROUP_FLAG_DIRTYcxx . . $ `src/bnetd/attrgroup.h:37:9`! 4 |
| 38 | |
| 39 | namespace pvpgncxx . . $ pvpgn/ |
| 40 | { |
| 41 | |
| 42 | namespace bnetdcxx . . $ pvpgn/bnetd/ |
| 43 | { |
| 44 | |
| 45 | /* attrgroup represents a group of attributes which are read/saved/flush together |
| 46 | * ex: each account stores it's data into a attrgroup */ |
| 47 | typedef struct attrgroup_structcxx . . $ pvpgn/bnetd/attrgroup_struct# |
| 48 | #ifdef ATTRGROUP_INTERNAL_ACCESScxx . . $ `src/bnetd/attrgroup.cpp:20:9`! |
| 49 | { |
| 50 | t_hlistcxx . . $ pvpgn/t_hlist# listcxx . . $ pvpgn/bnetd/attrgroup_struct#list.; |
| 51 | t_storage_infocxx . . $ pvpgn/bnetd/t_storage_info# *storagecxx . . $ pvpgn/bnetd/attrgroup_struct#storage.; |
| 52 | int flagscxx . . $ pvpgn/bnetd/attrgroup_struct#flags.; |
| 53 | stdcxx . . $ std/::time_tcxx . . $ std/time_t# lastaccesscxx . . $ pvpgn/bnetd/attrgroup_struct#lastaccess.; |
| 54 | stdcxx . . $ std/::time_tcxx . . $ std/time_t# dirtytimecxx . . $ pvpgn/bnetd/attrgroup_struct#dirtytime.; |
| 55 | t_elistcxx . . $ pvpgn/t_elist# loadedlistcxx . . $ pvpgn/bnetd/attrgroup_struct#loadedlist.; |
| 56 | t_elistcxx . . $ pvpgn/t_elist# dirtylistcxx . . $ pvpgn/bnetd/attrgroup_struct#dirtylist.; |
| 57 | #ifdef WITH_SQL |
| 58 | std::vector<const char*> *loadedtabs; /* sql table names that were loaded */ |
| 59 | #endif |
| 60 | } |
| 61 | #endif |
| 62 | t_attrgroupcxx . . $ pvpgn/bnetd/t_attrgroup#; |
| 63 | |
| 64 | typedef int(*t_attr_cbcxx . . $ pvpgn/bnetd/t_attr_cb#)(t_attrgroupcxx . . $ pvpgn/bnetd/t_attrgroup# *, void *); |
| 65 | |
| 66 | extern t_attrgroupcxx . . $ pvpgn/bnetd/t_attrgroup# *attrgroup_create_storagecxx . . $ pvpgn/bnetd/attrgroup_create_storage(46f131f0816d7ee8).(t_storage_infocxx . . $ pvpgn/bnetd/t_storage_info# *storage); |
| 67 | extern t_attrgroupcxx . . $ pvpgn/bnetd/t_attrgroup# *attrgroup_create_newusercxx . . $ pvpgn/bnetd/attrgroup_create_newuser(6822726a480688df).(const char *name); |
| 68 | extern t_attrgroupcxx . . $ pvpgn/bnetd/t_attrgroup# *attrgroup_create_nameuidcxx . . $ pvpgn/bnetd/attrgroup_create_nameuid(bbf52630eb81381c).(const char *name, unsigned uid); |
| 69 | extern int attrgroup_destroycxx . . $ pvpgn/bnetd/attrgroup_destroy(4a06131a44a32a35).(t_attrgroupcxx . . $ pvpgn/bnetd/t_attrgroup# *attrgroup); |
| 70 | extern int attrgroup_loadcxx . . $ pvpgn/bnetd/attrgroup_load(272c712ec47d72e9).(t_attrgroupcxx . . $ pvpgn/bnetd/t_attrgroup# *attrgroup, const char *tab); |
| 71 | extern int attrgroup_unloadcxx . . $ pvpgn/bnetd/attrgroup_unload(4a06131a44a32a35).(t_attrgroupcxx . . $ pvpgn/bnetd/t_attrgroup# *attrgroup); |
| 72 | extern int attrgroup_read_accountscxx . . $ pvpgn/bnetd/attrgroup_read_accounts(acb8d98e46f9914a).(int flag, t_attr_cbcxx . . $ pvpgn/bnetd/t_attr_cb# cb, void *data); |
| 73 | extern const char *attrgroup_get_attrcxx . . $ pvpgn/bnetd/attrgroup_get_attr(3e86f89d9efd4044).(t_attrgroupcxx . . $ pvpgn/bnetd/t_attrgroup# *attrgroup, const char *key); |
| 74 | extern int attrgroup_set_attrcxx . . $ pvpgn/bnetd/attrgroup_set_attr(3b126050c6ffe578).(t_attrgroupcxx . . $ pvpgn/bnetd/t_attrgroup# *attrgroup, const char *key, const char *val, bool set_dirty = true); |
| 75 | extern int attrgroup_savecxx . . $ pvpgn/bnetd/attrgroup_save(fe3030925edb1d32).(t_attrgroupcxx . . $ pvpgn/bnetd/t_attrgroup# *attrgroup, int flags); |
| 76 | extern int attrgroup_flushcxx . . $ pvpgn/bnetd/attrgroup_flush(fe3030925edb1d32).(t_attrgroupcxx . . $ pvpgn/bnetd/t_attrgroup# *attrgroup, int flags); |
| 77 | |
| 78 | } |
| 79 | |
| 80 | } |
| 81 | |
| 82 | #endif /* __ATTRGROUP_H_INCLUDED__ */ |