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;
    }

  • 相关阅读:
    C# 印刷文字识别-营业执照
    C# 印刷文字识别-身份证识别
    web视频点播平台
    web书籍信息管理系统
    web数字图书馆系统
    web文件监控系统
    web陶瓷商城管理系统
    web物品交易管理系统
    web校园单车管理平台
    web校园二手物品管理平台
  • 原文地址:https://www.cnblogs.com/greencolor/p/2219628.html
Copyright © 2011-2022 走看看