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

  • 相关阅读:
    下拉菜单年月日
    把某些字符替换成**;
    单击向下滚动,单击停止滚动,下拉显示top,点击top返回顶部
    去除网页中的选中和右键菜单
    表单验证必须为6-12位英文字母去除首尾空格
    免费的海量编程中文书籍索引-都是干货【强烈建议收藏】
    图标搜索网站
    表单验证
    HDU 6319 Problem A. Ascending Rating(单调队列)
    Palindrome Function HDU
  • 原文地址:https://www.cnblogs.com/greencolor/p/2219628.html
Copyright © 2011-2022 走看看