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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? iniparser.c

?? C Library to read Windows INI file
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*-------------------------------------------------------------------------*//**   @file    iniparser.c   @author  N. Devillard   @date    Sep 2007   @version 3.0   @brief   Parser for ini files.*//*--------------------------------------------------------------------------*//*    $Id: iniparser.c,v 2.18 2008-01-03 18:35:39 ndevilla Exp $    $Revision: 2.18 $    $Date: 2008-01-03 18:35:39 $*//*---------------------------- Includes ------------------------------------*/#include <ctype.h>#include "iniparser.h"/*---------------------------- Defines -------------------------------------*/#define ASCIILINESZ         (1024)#define INI_INVALID_KEY     ((char*)-1)/*---------------------------------------------------------------------------                        Private to this module ---------------------------------------------------------------------------*//** * This enum stores the status for each parsed line (internal use only). */typedef enum _line_status_ {    LINE_UNPROCESSED,    LINE_ERROR,    LINE_EMPTY,    LINE_COMMENT,    LINE_SECTION,    LINE_VALUE} line_status ;/*-------------------------------------------------------------------------*//**  @brief	Convert a string to lowercase.  @param	s	String to convert.  @return	ptr to statically allocated string.  This function returns a pointer to a statically allocated string  containing a lowercased version of the input string. Do not free  or modify the returned string! Since the returned string is statically  allocated, it will be modified at each function call (not re-entrant). *//*--------------------------------------------------------------------------*/static char * strlwc(const char * s){    static char l[ASCIILINESZ+1];    int i ;    if (s==NULL) return NULL ;    memset(l, 0, ASCIILINESZ+1);    i=0 ;    while (s[i] && i<ASCIILINESZ) {        l[i] = (char)tolower((int)s[i]);        i++ ;    }    l[ASCIILINESZ]=(char)0;    return l ;}/*-------------------------------------------------------------------------*//**  @brief	Remove blanks at the beginning and the end of a string.  @param	s	String to parse.  @return	ptr to statically allocated string.  This function returns a pointer to a statically allocated string,  which is identical to the input string, except that all blank  characters at the end and the beg. of the string have been removed.  Do not free or modify the returned string! Since the returned string  is statically allocated, it will be modified at each function call  (not re-entrant). *//*--------------------------------------------------------------------------*/static char * strstrip(char * s){    static char l[ASCIILINESZ+1];	char * last ;	    if (s==NULL) return NULL ;    	while (isspace((int)*s) && *s) s++;	memset(l, 0, ASCIILINESZ+1);	strcpy(l, s);	last = l + strlen(l);	while (last > l) {		if (!isspace((int)*(last-1)))			break ;		last -- ;	}	*last = (char)0;	return (char*)l ;}/*-------------------------------------------------------------------------*//**  @brief    Get number of sections in a dictionary  @param    d   Dictionary to examine  @return   int Number of sections found in dictionary  This function returns the number of sections found in a dictionary.  The test to recognize sections is done on the string stored in the  dictionary: a section name is given as "section" whereas a key is  stored as "section:key", thus the test looks for entries that do not  contain a colon.  This clearly fails in the case a section name contains a colon, but  this should simply be avoided.  This function returns -1 in case of error. *//*--------------------------------------------------------------------------*/int iniparser_getnsec(dictionary * d){    int i ;    int nsec ;    if (d==NULL) return -1 ;    nsec=0 ;    for (i=0 ; i<d->size ; i++) {        if (d->key[i]==NULL)            continue ;        if (strchr(d->key[i], ':')==NULL) {            nsec ++ ;        }    }    return nsec ;}/*-------------------------------------------------------------------------*//**  @brief    Get name for section n in a dictionary.  @param    d   Dictionary to examine  @param    n   Section number (from 0 to nsec-1).  @return   Pointer to char string  This function locates the n-th section in a dictionary and returns  its name as a pointer to a string statically allocated inside the  dictionary. Do not free or modify the returned string!  This function returns NULL in case of error. *//*--------------------------------------------------------------------------*/char * iniparser_getsecname(dictionary * d, int n){    int i ;    int foundsec ;    if (d==NULL || n<0) return NULL ;    foundsec=0 ;    for (i=0 ; i<d->size ; i++) {        if (d->key[i]==NULL)            continue ;        if (strchr(d->key[i], ':')==NULL) {            foundsec++ ;            if (foundsec>n)                break ;        }    }    if (foundsec<=n) {        return NULL ;    }    return d->key[i] ;}/*-------------------------------------------------------------------------*//**  @brief    Dump a dictionary to an opened file pointer.  @param    d   Dictionary to dump.  @param    f   Opened file pointer to dump to.  @return   void  This function prints out the contents of a dictionary, one element by  line, onto the provided file pointer. It is OK to specify @c stderr  or @c stdout as output files. This function is meant for debugging  purposes mostly. *//*--------------------------------------------------------------------------*/void iniparser_dump(dictionary * d, FILE * f){    int     i ;    if (d==NULL || f==NULL) return ;    for (i=0 ; i<d->size ; i++) {        if (d->key[i]==NULL)            continue ;        if (d->val[i]!=NULL) {            fprintf(f, "[%s]=[%s]\n", d->key[i], d->val[i]);        } else {            fprintf(f, "[%s]=UNDEF\n", d->key[i]);        }    }    return ;}/*-------------------------------------------------------------------------*//**  @brief    Save a dictionary to a loadable ini file  @param    d   Dictionary to dump  @param    f   Opened file pointer to dump to  @return   void  This function dumps a given dictionary into a loadable ini file.  It is Ok to specify @c stderr or @c stdout as output files. *//*--------------------------------------------------------------------------*/void iniparser_dump_ini(dictionary * d, FILE * f){    int     i, j ;    char    keym[ASCIILINESZ+1];    int     nsec ;    char *  secname ;    int     seclen ;    if (d==NULL || f==NULL) return ;    nsec = iniparser_getnsec(d);    if (nsec<1) {        /* No section in file: dump all keys as they are */        for (i=0 ; i<d->size ; i++) {            if (d->key[i]==NULL)                continue ;            fprintf(f, "%s = %s\n", d->key[i], d->val[i]);        }        return ;    }    for (i=0 ; i<nsec ; i++) {        secname = iniparser_getsecname(d, i) ;        seclen  = (int)strlen(secname);        fprintf(f, "\n[%s]\n", secname);        sprintf(keym, "%s:", secname);        for (j=0 ; j<d->size ; j++) {            if (d->key[j]==NULL)                continue ;            if (!strncmp(d->key[j], keym, seclen+1)) {                fprintf(f,                        "%-30s = %s\n",                        d->key[j]+seclen+1,                        d->val[j] ? d->val[j] : "");            }        }    }    fprintf(f, "\n");    return ;}/*-------------------------------------------------------------------------*//**  @brief    Get the string associated to a key  @param    d       Dictionary to search  @param    key     Key string to look for  @param    def     Default value to return if key not found.  @return   pointer to statically allocated character string  This function queries a dictionary for a key. A key as read from an  ini file is given as "section:key". If the key cannot be found,  the pointer passed as 'def' is returned.  The returned char pointer is pointing to a string allocated in  the dictionary, do not free or modify it. *//*--------------------------------------------------------------------------*/char * iniparser_getstring(dictionary * d, const char * key, char * def){    char * lc_key ;    char * sval ;    if (d==NULL || key==NULL)        return def ;    lc_key = strlwc(key);    sval = dictionary_get(d, lc_key, def);    return sval ;}/*-------------------------------------------------------------------------*//**  @brief    Get the string associated to a key, convert to an int  @param    d Dictionary to search  @param    key Key string to look for  @param    notfound Value to return in case of error  @return   integer  This function queries a dictionary for a key. A key as read from an  ini file is given as "section:key". If the key cannot be found,  the notfound value is returned.  Supported values for integers include the usual C notation  so decimal, octal (starting with 0) and hexadecimal (starting with 0x)  are supported. Examples:  "42"      ->  42  "042"     ->  34 (octal -> decimal)  "0x42"    ->  66 (hexa  -> decimal)  Warning: the conversion may overflow in various ways. Conversion is  totally outsourced to strtol(), see the associated man page for overflow  handling.  Credits: Thanks to A. Becker for suggesting strtol() *//*--------------------------------------------------------------------------*/int iniparser_getint(dictionary * d, const char * key, int notfound){    char    *   str ;    str = iniparser_getstring(d, key, INI_INVALID_KEY);    if (str==INI_INVALID_KEY) return notfound ;    return (int)strtol(str, NULL, 0);}/*-------------------------------------------------------------------------*//**  @brief    Get the string associated to a key, convert to a double  @param    d Dictionary to search  @param    key Key string to look for  @param    notfound Value to return in case of error  @return   double

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩久久久一区| 三级影片在线观看欧美日韩一区二区 | 在线观看不卡一区| 精品日韩欧美在线| 亚洲bdsm女犯bdsm网站| 成人免费黄色大片| 精品福利av导航| 婷婷久久综合九色综合伊人色| 丰满少妇在线播放bd日韩电影| 欧美一级片在线观看| 亚洲午夜日本在线观看| 99久久777色| 中文字幕亚洲在| 国产成a人亚洲精| 久久众筹精品私拍模特| 蓝色福利精品导航| 欧美年轻男男videosbes| 亚洲午夜在线视频| 在线观看国产一区二区| 亚洲精品免费播放| 色狠狠桃花综合| 亚洲免费av高清| 欧美在线小视频| 亚洲国产日韩一区二区| 欧美日韩在线观看一区二区| 一区2区3区在线看| 在线中文字幕一区| 亚洲国产一区二区在线播放| 精品视频在线免费看| 一区二区三区国产| 欧美精品日韩精品| 日本sm残虐另类| 欧美va日韩va| 国产成人精品免费在线| 国产精品萝li| 91免费看`日韩一区二区| 亚洲天堂a在线| 色呦呦网站一区| 亚洲一区二区在线视频| 欧美日韩国产精选| 久久国内精品自在自线400部| 日韩精品中午字幕| 国产a久久麻豆| 亚洲人成在线播放网站岛国| 色国产综合视频| 婷婷国产在线综合| 日韩免费成人网| 成人一区二区三区视频| 亚洲乱码一区二区三区在线观看| 在线免费一区三区| 免费成人结看片| 欧美激情一区二区三区| 色8久久精品久久久久久蜜| 午夜一区二区三区在线观看| 日韩一区二区三区精品视频| 国产精品1024久久| 夜夜爽夜夜爽精品视频| 日韩一级片在线播放| 国产大片一区二区| 亚洲午夜视频在线| 久久精品一区八戒影视| 色94色欧美sute亚洲线路二| 麻豆精品久久久| 久久99国产乱子伦精品免费| 国产精品久久三| 91精品国产欧美一区二区成人| 激情久久五月天| 一区二区三区电影在线播| 精品少妇一区二区三区免费观看| 不卡的av电影在线观看| 日本午夜一区二区| 亚洲少妇最新在线视频| 亚洲风情在线资源站| 久久久久久黄色| 欧美三级中文字幕在线观看| 国产成人99久久亚洲综合精品| 亚洲五月六月丁香激情| 国产精品理伦片| 日韩一区二区电影| 欧美偷拍一区二区| 成人免费精品视频| 久草中文综合在线| 天堂一区二区在线免费观看| 日本一区二区成人| 精品久久一区二区三区| 欧美日韩国产区一| 91麻豆精品在线观看| 成人免费精品视频| 国产高清精品在线| 另类中文字幕网| 午夜精品久久久久久久久久| 亚洲欧洲av在线| 国产日韩欧美a| 欧美大片在线观看一区| 欧美日韩亚洲高清一区二区| 色婷婷综合激情| 成人激情电影免费在线观看| 国产一区二区毛片| 蜜桃av噜噜一区二区三区小说| 一区二区三区蜜桃网| 日韩一区中文字幕| 国产精品每日更新在线播放网址| 久久久午夜电影| 亚洲精品一区二区三区四区高清| 在线播放中文一区| 欧美日韩一区 二区 三区 久久精品 | eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 奇米影视一区二区三区| 午夜天堂影视香蕉久久| 天堂在线一区二区| 日本女人一区二区三区| 蜜臀av性久久久久蜜臀av麻豆| 视频一区二区三区入口| 婷婷国产v国产偷v亚洲高清| 日韩不卡免费视频| 麻豆成人在线观看| 国产精品 欧美精品| 成人丝袜18视频在线观看| 不卡大黄网站免费看| 色婷婷亚洲一区二区三区| 色欧美日韩亚洲| 欧美区一区二区三区| 欧美一级欧美一级在线播放| 日韩欧美国产午夜精品| 久久精品日产第一区二区三区高清版| 久久精品一区二区三区四区| 日本一区二区三区在线观看| 亚洲丝袜美腿综合| 亚洲成人一区二区在线观看| 天天色天天爱天天射综合| 99视频热这里只有精品免费| 欧美一a一片一级一片| 69堂精品视频| 久久久噜噜噜久噜久久综合| 中文字幕在线免费不卡| 亚洲一区二区三区小说| 免费观看在线色综合| 国产盗摄一区二区三区| 91福利国产成人精品照片| 欧美一级黄色录像| 国产精品久久影院| 亚洲电影你懂得| 国产sm精品调教视频网站| 欧美在线高清视频| 精品国产凹凸成av人导航| 亚洲欧美激情插| 国精产品一区一区三区mba桃花 | 亚洲欧洲无码一区二区三区| 日日嗨av一区二区三区四区| 国产精品亚洲视频| 欧美视频三区在线播放| 国产午夜亚洲精品午夜鲁丝片| 亚洲愉拍自拍另类高清精品| 韩国女主播成人在线| 欧美亚日韩国产aⅴ精品中极品| 精品国产91洋老外米糕| 亚洲精品国产第一综合99久久| 开心九九激情九九欧美日韩精美视频电影 | 欧美精品一区二区三| 亚洲欧美区自拍先锋| 国产一区 二区| 欧美日韩大陆一区二区| 国产精品成人免费在线| 黄色小说综合网站| 在线播放中文一区| 最新国产の精品合集bt伙计| 九九视频精品免费| 欧美人与禽zozo性伦| 中文字幕字幕中文在线中不卡视频| 免费在线观看成人| 欧美久久久一区| 亚洲女性喷水在线观看一区| 国产一区二区三区香蕉| 91精品国产综合久久精品app| 最好看的中文字幕久久| 国产激情精品久久久第一区二区 | 激情伊人五月天久久综合| 欧美在线看片a免费观看| 国产精品久久久久久久久免费桃花 | 成人av综合一区| 久久夜色精品国产欧美乱极品| 亚洲高清不卡在线| 欧美亚男人的天堂| 亚洲制服丝袜av| 色婷婷亚洲一区二区三区| 中文字幕亚洲成人| 成人深夜视频在线观看| 久久婷婷国产综合精品青草| 日韩av中文在线观看| 欧美日韩电影一区| 五月激情丁香一区二区三区| 欧美在线高清视频| 亚洲成av人片在线观看无码| 91福利视频在线| 亚洲一区二区三区国产| 在线这里只有精品| 亚洲一二三区在线观看| 欧美性做爰猛烈叫床潮| 五月天中文字幕一区二区| 欧美人动与zoxxxx乱|