亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? storage_file.c

?? 打魔獸戰(zhàn)網(wǎng)的都知道他是什么
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright (C) 1998,1999,2000,2001  Ross Combs (rocombs@cs.nmsu.edu) * Copyright (C) 2000,2001  Marco Ziech (mmz@gmx.net) * Copyright (C) 2002,2003,2004 Dizzy  * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. */#include "common/setup_before.h"#include <stdio.h>#ifdef HAVE_STDDEF_H# include <stddef.h>#else# ifndef NULL#  define NULL ((void *)0)# endif#endif#ifdef STDC_HEADERS# include <stdlib.h>#else# ifdef HAVE_MALLOC_H#  include <malloc.h># endif#endif#ifdef HAVE_STRING_H# include <string.h>#else# ifdef HAVE_STRINGS_H#  include <strings.h># endif#endif#include "compat/strchr.h"#include "compat/strdup.h"#include "compat/strcasecmp.h"#include "compat/strncasecmp.h"#include <ctype.h>#ifdef HAVE_LIMITS_H# include <limits.h>#endif#include "compat/char_bit.h"#ifdef TIME_WITH_SYS_TIME# include <sys/time.h># include <time.h>#else# ifdef HAVE_SYS_TIME_H#  include <sys/time.h># else#  include <time.h># endif#endif#include <errno.h>#include "compat/strerror.h"#ifdef HAVE_SYS_TYPES_H# include <sys/types.h>#endif#ifdef HAVE_UNISTD_H# include <unistd.h>#endif#include "compat/access.h"#include "compat/rename.h"#include "compat/pdir.h"#include "common/eventlog.h"#include "prefs.h"#include "common/util.h"#include "common/field_sizes.h"#include "common/bnethash.h"#define CLAN_INTERNAL_ACCESS#define TEAM_INTERNAL_ACCESS#include "common/introtate.h"#include "team.h"#include "account.h"#include "common/hashtable.h"#include "storage.h"#include "storage_file.h"#include "file_plain.h"#include "file_cdb.h"#include "common/list.h"#include "connection.h"#include "watch.h"#include "clan.h"#undef ACCOUNT_INTERNAL_ACCESS#undef TEAM_INTERNAL_ACCESS#undef CLAN_INTERNAL_ACCESS#include "common/tag.h"#include "common/xalloc.h"#include "common/elist.h"#include "common/setup_after.h"/* file storage API functions */static int file_init(const char *);static int file_close(void);static unsigned file_read_maxuserid(void);static t_storage_info *file_create_account(char const *);static t_storage_info *file_get_defacct(void);static int file_free_info(t_storage_info *);static int file_read_attrs(t_storage_info *, t_read_attr_func, void *);static t_attr *file_read_attr(t_storage_info *, const char *);static int file_write_attrs(t_storage_info *, const t_hlist *);static int file_read_accounts(int,t_read_accounts_func, void *);static t_storage_info *file_read_account(const char *, unsigned);static int file_cmp_info(t_storage_info *, t_storage_info *);static const char *file_escape_key(const char *);static int file_load_clans(t_load_clans_func);static int file_write_clan(void *);static int file_remove_clan(int);static int file_remove_clanmember(int);static int file_load_teams(t_load_teams_func);static int file_write_team(void *);static int file_remove_team(unsigned int);/* storage struct populated with the functions above */t_storage storage_file = {    file_init,    file_close,    file_read_maxuserid,    file_create_account,    file_get_defacct,    file_free_info,    file_read_attrs,    file_write_attrs,    file_read_attr,    file_read_accounts,    file_read_account,    file_cmp_info,    file_escape_key,    file_load_clans,    file_write_clan,    file_remove_clan,    file_remove_clanmember,    file_load_teams,    file_write_team,    file_remove_team};/* start of actual file storage code */static const char *accountsdir = NULL;static const char *clansdir = NULL;static const char *teamsdir = NULL;static const char *defacct = NULL;static t_file_engine *file = NULL;static unsigned file_read_maxuserid(void){    return maxuserid;}static int file_init(const char *path){    char *tok, *copy, *tmp, *p;    const char *dir = NULL;    const char *clan = NULL;    const char *team = NULL;    const char *def = NULL;    const char *driver = NULL;    if (path == NULL || path[0] == '\0')    {	eventlog(eventlog_level_error, __FUNCTION__, "got NULL or empty path");	return -1;    }    copy = xstrdup(path);    tmp = copy;    while ((tok = strtok(tmp, ";")) != NULL)    {	tmp = NULL;	if ((p = strchr(tok, '=')) == NULL)	{	    eventlog(eventlog_level_error, __FUNCTION__, "invalid storage_path, no '=' present in token");	    xfree((void *) copy);	    return -1;	}	*p = '\0';	if (strcasecmp(tok, "dir") == 0)	    dir = p + 1;	else if (strcasecmp(tok, "clan") == 0)	    clan = p + 1;	else if (strcasecmp(tok, "team") == 0)	    team = p + 1;	else if (strcasecmp(tok, "default") == 0)	    def = p + 1;	else if (strcasecmp(tok, "mode") == 0)	    driver = p + 1;	else	    eventlog(eventlog_level_warn, __FUNCTION__, "unknown token in storage_path : '%s'", tok);    }    if (def == NULL || clan == NULL || team == NULL || dir == NULL || driver == NULL)    {	eventlog(eventlog_level_error, __FUNCTION__, "invalid storage_path line for file module (doesnt have a 'dir', a 'clan', a 'team', a 'default' token and a 'mode' token)");	xfree((void *) copy);	return -1;    }    if (!strcasecmp(driver, "plain"))	file = &file_plain;    else if (!strcasecmp(driver, "cdb"))	file = &file_cdb;    else    {	eventlog(eventlog_level_error, __FUNCTION__, "unknown mode '%s' must be either plain or cdb", driver);	xfree((void *) copy);	return -1;    }    if (accountsdir)	file_close();    accountsdir = xstrdup(dir);    clansdir = xstrdup(clan);    teamsdir = xstrdup(team);    defacct = xstrdup(def);    xfree((void *) copy);    return 0;}static int file_close(void){    if (accountsdir)	xfree((void *) accountsdir);    accountsdir = NULL;    if (clansdir)	xfree((void *) clansdir);    clansdir = NULL;    if (teamsdir)    	xfree((void *) teamsdir);    teamsdir = NULL;    if (defacct)	xfree((void *) defacct);    defacct = NULL;    file = NULL;    return 0;}static t_storage_info *file_create_account(const char *username){    char *temp;    if (accountsdir == NULL || file == NULL)    {	eventlog(eventlog_level_error, __FUNCTION__, "file storage not initilized");	return NULL;    }    if (prefs_get_savebyname())    {	char const *safename;	if (!strcmp(username, defacct))	{	    eventlog(eventlog_level_error, __FUNCTION__, "username as defacct not allowed");	    return NULL;	}	if (!(safename = escape_fs_chars(username, strlen(username))))	{	    eventlog(eventlog_level_error, __FUNCTION__, "could not escape username");	    return NULL;	}	temp = xmalloc(strlen(accountsdir) + 1 + strlen(safename) + 1);	/* dir + / + name + NUL */	sprintf(temp, "%s/%s", accountsdir, safename);	xfree((void *) safename);	/* avoid warning */    } else    {	temp = xmalloc(strlen(accountsdir) + 1 + 8 + 1);	/* dir + / + uid + NUL */	sprintf(temp, "%s/%06u", accountsdir, maxuserid + 1);	/* FIXME: hmm, maybe up the %06 to %08... */    }    return temp;}static int file_write_attrs(t_storage_info * info, const t_hlist *attributes){    char *tempname;    if (accountsdir == NULL || file == NULL)    {	eventlog(eventlog_level_error, __FUNCTION__, "file storage not initilized");	return -1;    }    if (info == NULL)    {	eventlog(eventlog_level_error, __FUNCTION__, "got NULL info storage");	return -1;    }    if (attributes == NULL)    {	eventlog(eventlog_level_error, __FUNCTION__, "got NULL attributes");	return -1;    }    tempname = xmalloc(strlen(accountsdir) + 1 + strlen(BNETD_ACCOUNT_TMP) + 1);    sprintf(tempname, "%s/%s", accountsdir, BNETD_ACCOUNT_TMP);    if (file->write_attrs(tempname, attributes))    {	/* no eventlog here, it should be reported from the file layer */	xfree(tempname);	return -1;    }    if (p_rename(tempname, (const char *) info) < 0)    {	eventlog(eventlog_level_error, __FUNCTION__, "could not rename account file to \"%s\" (rename: %s)", (char *) info, pstrerror(errno));	xfree(tempname);	return -1;    }    xfree(tempname);    return 0;}static int file_read_attrs(t_storage_info * info, t_read_attr_func cb, void *data){    if (accountsdir == NULL || file == NULL)    {	eventlog(eventlog_level_error, __FUNCTION__, "file storage not initilized");	return -1;    }    if (info == NULL)    {	eventlog(eventlog_level_error, __FUNCTION__, "got NULL info storage");	return -1;    }    if (cb == NULL)    {	eventlog(eventlog_level_error, __FUNCTION__, "got NULL callback");	return -1;    }    eventlog(eventlog_level_debug, __FUNCTION__, "loading \"%s\"", (char *) info);    if (file->read_attrs((const char *) info, cb, data))    {	/* no eventlog, error reported earlier */	return -1;    }    return 0;}static t_attr *file_read_attr(t_storage_info * info, const char *key){    if (accountsdir == NULL || file == NULL)    {	eventlog(eventlog_level_error, __FUNCTION__, "file storage not initilized");	return NULL;    }    if (info == NULL)    {	eventlog(eventlog_level_error, __FUNCTION__, "got NULL info storage");	return NULL;    }    if (key == NULL)    {	eventlog(eventlog_level_error, __FUNCTION__, "got NULL key");	return NULL;    }    return file->read_attr((const char *) info, key);}static int file_free_info(t_storage_info * info){    if (info)	xfree((void *) info);    return 0;}static t_storage_info *file_get_defacct(void){    t_storage_info *info;    if (defacct == NULL)    {	eventlog(eventlog_level_error, __FUNCTION__, "file storage not initilized");	return NULL;    }    info = xstrdup(defacct);    return info;}static int file_read_accounts(int flag,t_read_accounts_func cb, void *data){    char const *dentry;    char *pathname;    t_pdir *accountdir;    if (accountsdir == NULL)    {	eventlog(eventlog_level_error, __FUNCTION__, "file storage not initilized");	return -1;    }    if (cb == NULL)    {	eventlog(eventlog_level_error, __FUNCTION__, "got NULL callback");	return -1;    }    if (!(accountdir = p_opendir(accountsdir)))    {	eventlog(eventlog_level_error, __FUNCTION__, "unable to open user directory \"%s\" for reading (p_opendir: %s)", accountsdir, pstrerror(errno));	return -1;    }    while ((dentry = p_readdir(accountdir)))    {	if (dentry[0] == '.')	    continue;	pathname = xmalloc(strlen(accountsdir) + 1 + strlen(dentry) + 1);	/* dir + / + file + NUL */	sprintf(pathname, "%s/%s", accountsdir, dentry);	cb(pathname, data);    }    if (p_closedir(accountdir) < 0)	eventlog(eventlog_level_error, __FUNCTION__, "unable to close user directory \"%s\" (p_closedir: %s)", accountsdir, pstrerror(errno));    return 0;}static t_storage_info *file_read_account(const char *accname, unsigned uid){    char *pathname;    if (accountsdir == NULL)    {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产女人18水真多18精品一级做| 欧美在线三级电影| 精品少妇一区二区| 久久99精品久久久久久国产越南| 日韩一区二区三区在线观看| 麻豆精品一区二区综合av| 日韩欧美一级片| 国产精品一二三四| 一区在线观看免费| 欧美无人高清视频在线观看| 亚洲国产精品一区二区久久恐怖片| 欧美性猛交xxxxxx富婆| 日韩成人免费电影| 欧美精品一区二区三区在线播放| 国产精品亚洲综合一区在线观看| 国产精品久久久久四虎| 91丝袜美腿高跟国产极品老师| 一区二区在线观看不卡| 欧美日韩高清一区二区| 精品中文av资源站在线观看| 国产精品久久久久久户外露出| 在线精品视频免费播放| 日韩福利视频导航| 国产精品久久久久影视| 欧美日韩成人激情| 高清国产午夜精品久久久久久| 亚洲天堂成人在线观看| 制服丝袜一区二区三区| 成人禁用看黄a在线| 日韩精品视频网站| 亚洲欧洲日韩在线| 日韩欧美色综合| av电影在线观看完整版一区二区| 日日夜夜免费精品| 国产精品美女www爽爽爽| 91精品国产综合久久精品性色| 国产一区二区在线免费观看| 亚洲一区二区欧美日韩| 久久久久久免费| 在线不卡的av| 91麻豆精东视频| 久久国产精品99久久人人澡| 亚洲永久免费视频| 中文字幕不卡在线观看| 欧美一区二视频| 91高清视频免费看| 国产电影精品久久禁18| 五月激情综合网| 国产精品国产三级国产aⅴ无密码| 欧美精品v国产精品v日韩精品| 成人h动漫精品| 加勒比av一区二区| 日韩国产在线一| 亚洲精品福利视频网站| 中文av一区二区| 精品国产乱子伦一区| 欧美日韩一区二区在线视频| www.欧美日韩国产在线| 国产精品一二三区在线| 精一区二区三区| 国产精品资源在线观看| 日韩福利视频网| 亚洲成a人片在线观看中文| 亚洲欧洲成人精品av97| 国产日韩一级二级三级| 久久夜色精品国产噜噜av| 制服丝袜亚洲网站| 欧美丝袜丝nylons| 色婷婷精品大在线视频| av高清久久久| www.在线成人| 成人国产在线观看| 成人国产精品免费网站| 成人a区在线观看| av亚洲精华国产精华| 成人免费视频播放| 99久久国产综合精品麻豆| 白白色 亚洲乱淫| 一本久久综合亚洲鲁鲁五月天| 天天亚洲美女在线视频| 日日噜噜夜夜狠狠视频欧美人 | 一本色道a无线码一区v| av一二三不卡影片| 91蝌蚪porny| 欧美亚洲一区二区在线| 欧美色电影在线| 欧美精品在线视频| 日韩一区二区三区四区| 欧美一区二区大片| 26uuu成人网一区二区三区| 久久久国产一区二区三区四区小说| 精品国产一区二区在线观看| 久久久精品欧美丰满| 国产精品人妖ts系列视频| 亚洲日本乱码在线观看| 一区二区三区久久| 秋霞午夜鲁丝一区二区老狼| 紧缚捆绑精品一区二区| a4yy欧美一区二区三区| 日本韩国精品在线| 4438x成人网最大色成网站| 久久一二三国产| 成人欧美一区二区三区小说| 亚洲不卡在线观看| 极品美女销魂一区二区三区 | 91在线观看视频| 91美女在线视频| 91精品国产综合久久久久| 欧美精品一区二区三区在线播放 | 精品午夜久久福利影院| 狠狠久久亚洲欧美| 91免费国产在线| 欧美久久婷婷综合色| 久久精品亚洲精品国产欧美kt∨| 亚洲青青青在线视频| 日本不卡一区二区三区高清视频| 精品一二三四区| 日本高清不卡在线观看| 日韩一区二区在线观看视频播放| 国产亚洲精品免费| 亚洲成人av免费| 国产v综合v亚洲欧| 在线播放亚洲一区| 国产精品热久久久久夜色精品三区| 亚洲一区二区三区激情| 国产成人午夜片在线观看高清观看| 在线精品视频小说1| 久久久久国产免费免费| 亚洲国产成人高清精品| 国产一区二区三区四| 欧美日韩三级一区二区| 国产精品丝袜黑色高跟| 免费成人深夜小野草| 91国产免费观看| 日本一区二区不卡视频| 性做久久久久久免费观看欧美| 大桥未久av一区二区三区中文| 欧美日韩卡一卡二| 亚洲免费在线视频| 国产91富婆露脸刺激对白| 日韩视频一区二区三区| 亚洲一区二区三区精品在线| 成人小视频免费在线观看| 日韩一级片在线播放| 亚洲另类中文字| www.av精品| 国产视频一区二区三区在线观看| 日韩黄色在线观看| 在线观看精品一区| 亚洲私人影院在线观看| 国产精品一区久久久久| 日韩欧美不卡在线观看视频| 国产999精品久久| 欧美一区二区三区性视频| 一区二区在线观看av| 91捆绑美女网站| 中文字幕一区日韩精品欧美| 成人蜜臀av电影| 国产日产欧美一区二区三区| 国产一级精品在线| 久久综合久久综合亚洲| 美女在线视频一区| 日韩精品一区在线| 久久99精品国产.久久久久久 | 狠狠网亚洲精品| 91精品在线免费| 人人爽香蕉精品| 日韩欧美中文字幕精品| 日本伊人午夜精品| 日韩欧美国产麻豆| 久久国产精品露脸对白| 精品成人免费观看| 国产成人综合在线观看| 国产人成亚洲第一网站在线播放| 激情深爱一区二区| 国产婷婷一区二区| 国产99精品在线观看| 国产精品国产自产拍在线| 97se亚洲国产综合自在线不卡| 亚洲丝袜制服诱惑| 色丁香久综合在线久综合在线观看| 亚洲美女偷拍久久| 欧美日韩国产乱码电影| 青青草97国产精品免费观看无弹窗版| 欧美一级搡bbbb搡bbbb| 激情综合网天天干| 欧美国产一区视频在线观看| 99re热这里只有精品视频| 伊人一区二区三区| 欧美一区二区三区视频免费播放| 久久成人麻豆午夜电影| 国产调教视频一区| 91久久免费观看| 日韩av一二三| 久久精品日产第一区二区三区高清版| 不卡av电影在线播放| 亚洲国产精品久久一线不卡| 欧美电影免费观看高清完整版在线观看| 激情成人午夜视频| 亚洲欧美日韩综合aⅴ视频|