亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩视频免费观看高清完整版在线观看| 国产视频一区不卡| 久久亚洲欧美国产精品乐播| 亚洲欧洲综合另类在线| 麻豆一区二区三区| a4yy欧美一区二区三区| 久久先锋资源网| 无码av免费一区二区三区试看| 成人一区二区三区视频| 日韩一区二区高清| 亚洲国产精品久久人人爱蜜臀| 丰满岳乱妇一区二区三区| 欧美一区二区三区男人的天堂| 亚洲男人天堂av| hitomi一区二区三区精品| 26uuu色噜噜精品一区| 蜜臀精品久久久久久蜜臀| 欧美这里有精品| 亚洲日本在线a| 国产成人在线影院| 欧美精品一区二区三区在线| 日韩精品乱码免费| 色婷婷精品久久二区二区蜜臂av| 国产精品久久毛片a| 国产69精品久久777的优势| 久久综合久久综合久久| 蜜桃精品视频在线| 欧美一区二区三区系列电影| 亚洲第一搞黄网站| 欧美日韩午夜在线视频| 亚洲一区在线视频| 欧美午夜精品久久久久久超碰| 亚洲人成网站精品片在线观看| 成人听书哪个软件好| 中文字幕精品三区| 成人激情校园春色| 亚洲欧洲精品一区二区三区不卡 | 99在线视频精品| 欧美激情一区二区| 成人激情动漫在线观看| 国产精品久久免费看| 99久久国产综合色|国产精品| 综合久久给合久久狠狠狠97色| 91在线国产福利| 亚洲综合一区二区精品导航| 欧美日韩一区成人| 久久精品噜噜噜成人av农村| 精品日韩在线观看| 福利91精品一区二区三区| 日韩美女久久久| 欧美日韩精品欧美日韩精品| 秋霞电影一区二区| 国产色婷婷亚洲99精品小说| 91在线观看视频| 视频一区二区不卡| 国产午夜久久久久| 色综合久久综合网| 日本成人在线不卡视频| 久久久噜噜噜久噜久久综合| 99久久久国产精品| 亚洲国产视频一区二区| 日韩欧美国产不卡| 成人免费视频网站在线观看| 怡红院av一区二区三区| 日韩欧美一区中文| 成人18视频日本| 午夜天堂影视香蕉久久| 久久综合九色综合久久久精品综合| 高清视频一区二区| 午夜视频在线观看一区二区| 久久久久久久久久看片| 欧美最猛黑人xxxxx猛交| 狠狠色丁香婷婷综合久久片| 亚洲人精品午夜| 精品久久一二三区| 91成人免费在线| 国内精品国产成人| 亚洲成人综合网站| 国产精品天干天干在线综合| 91精品免费在线| 91在线国内视频| 国产麻豆91精品| 日韩中文字幕亚洲一区二区va在线| 久久精品在线免费观看| 欧美日韩免费不卡视频一区二区三区| 国产酒店精品激情| 日本成人超碰在线观看| 亚洲精品v日韩精品| 国产日产欧美一区| 日韩欧美久久久| 在线亚洲欧美专区二区| 成人综合在线观看| 久久er精品视频| 婷婷成人综合网| 伊人开心综合网| 国产精品国产三级国产普通话蜜臀 | 国产精品视频一二| 欧美v日韩v国产v| 欧美嫩在线观看| 欧美日韩精品二区第二页| 99热在这里有精品免费| 国产欧美日韩综合| 欧美日韩高清一区二区不卡| 精品一区二区三区免费| 日本亚洲三级在线| 亚洲超碰精品一区二区| 国产精品久久久久影院老司 | 亚洲风情在线资源站| 精品免费国产二区三区 | 视频在线观看一区| 夜夜嗨av一区二区三区网页 | 欧美午夜在线观看| 91亚洲大成网污www| 成人午夜av电影| 波波电影院一区二区三区| 国产成人精品免费网站| 国产一区二三区| 国产精品18久久久久久久网站| 蜜桃视频第一区免费观看| 精品一二三四区| 久久精品国产久精国产爱| 日韩一区二区在线看| 日本亚洲欧美天堂免费| 综合久久久久综合| 亚洲综合色婷婷| 午夜视频在线观看一区二区| 日韩高清中文字幕一区| 亚洲大片在线观看| 首页综合国产亚洲丝袜| 免费在线观看成人| 美国毛片一区二区| 国产成人精品亚洲日本在线桃色| 国产在线播放一区三区四| 国产精品99久久久久| av在线不卡免费看| 欧美中文一区二区三区| 欧美福利一区二区| 久久一日本道色综合| 国产午夜久久久久| 亚洲综合小说图片| 久久精品国产一区二区三区免费看| 韩国三级电影一区二区| 成人av在线网站| 欧美日韩精品欧美日韩精品| 精品少妇一区二区三区在线播放 | 色一情一乱一乱一91av| 欧美影视一区二区三区| 欧美va亚洲va香蕉在线| 中文字幕一区在线| 亚洲综合色视频| 韩国欧美一区二区| 99综合影院在线| 欧美日本一区二区三区| 欧美一级黄色片| 欧美国产精品中文字幕| 亚洲一区二区三区小说| 久久国产精品无码网站| www.成人在线| 日韩一区二区三区高清免费看看| 国产丝袜在线精品| 亚洲成人黄色影院| 国内一区二区在线| 欧美三级视频在线观看| 久久九九99视频| 日本不卡一二三| 9色porny自拍视频一区二区| 欧美一二三四区在线| 中文字幕中文字幕在线一区| 午夜精品爽啪视频| 色偷偷一区二区三区| 中文字幕av免费专区久久| 日韩国产精品大片| 欧美在线播放高清精品| 综合久久综合久久| 国产精品18久久久久| 日韩欧美国产综合| 91色porny| 美女国产一区二区三区| 久久影视一区二区| 91福利国产精品| 午夜精品久久久| 国产精品沙发午睡系列990531| 中文字幕+乱码+中文字幕一区| 日韩av一区二区三区| 日本高清视频一区二区| 国产精品视频第一区| 国产麻豆精品在线| 日韩精品专区在线影院重磅| 亚洲影视在线播放| 色欧美片视频在线观看在线视频| 国产日本欧美一区二区| 韩国v欧美v亚洲v日本v| 欧美tk—视频vk| 国模大尺度一区二区三区| 欧美不卡一区二区三区四区| 日韩成人av影视| 欧美精品三级在线观看| 日韩影视精彩在线| 欧美二区乱c少妇| 欧美aa在线视频|