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

  • 相关阅读:
    分布式一致性模型
    ubuntu18.04 基于Hadoop3.1.2集群的Hbase2.0.6集群搭建
    ubuntu18.04 flink-1.9.0 Standalone集群搭建
    Idea 打印GC
    goroutine简介
    MESI缓存一致性协议
    Spark RDD 算子总结
    SparkStreaming 笔记
    Spark 内存管理
    Highcharts(数据分析图)
  • 原文地址:https://www.cnblogs.com/greencolor/p/2219628.html
Copyright © 2011-2022 走看看