zoukankan      html  css  js  c++  java
  • readOneSectionFromDumpfile


    readOneSectionFromDumpfile(fopen( filename, "r" ))

    static int readOneSectionFromDumpfile( FILE* dumpFile )
    {
        memset( dumpFileSection, 0, sizeof(dumpFileSection) );
        numLineForSection = 0;

        while (1)
        {
            if (feof( dumpFile ) || ferror( dumpFile ))
            {
                break;
            }
            char *pLine = dumpFileSection[numLineForSection];
            fgets( pLine, MAX_LINE_SIZE, dumpFile );
            trimString( pLine );
            if (!stringIsPrintable( pLine ))
            {
                if (numLineForSection > 0)
                {
                    printf( "non-printable character found in %s line %d {%s}\n",
                         dumpFileSection[0], numLineForSection, pLine );
                }
                else
                {
                    printf( "non-printable character found in name {%s}\n",
                         pLine );
                }
                exit( -1 );
            }
            size_t ll = strlen( pLine );
            if (ll > 0)
            {
                ++numLineForSection;
                if (numLineForSection > MAX_NUM_LINE)
                {
                    printf( "exceed max number of lines per section" );
                    exit( -1 );
                }
            }
            else
            {
                if (numLineForSection)
                {
                    break;
                }
            }
        }
        return numLineForSection;
    }

  • 相关阅读:
    案例的法律分析
    被投资人“送”入看守所 z
    easyUI样式之easyui-switchbutton
    阿里大于发送短信(java)
    java Random.nextInt()方法
    DateFormatUtil格式化时间
    MessageFormat.format 字符串的模板替换
    JsonArray对象
    jsonObject关于xml,json,bean之间的转换关系
    Java 使用IE浏览器下载文件,文件名乱码问题
  • 原文地址:https://www.cnblogs.com/greencolor/p/2219628.html
Copyright © 2011-2022 走看看