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

  • 相关阅读:
    Axios 各种请求方式传递参数格式
    axios POST提交数据的三种请求方式写法
    Json对象和Json字符串的区别
    ASP.NET Core 使用 AutoFac 注入 DbContext
    asp.net core signalr Error: Failed to start the transport 'WebSockets': null
    js中settimeout和setinterval的区别是什么?
    VS IDE开发字体推荐
    .net core ef core 自动迁移,自动修改数据库
    localstorage和sessionstorage的区别
    TinyOS编程
  • 原文地址:https://www.cnblogs.com/greencolor/p/2219628.html
Copyright © 2011-2022 走看看