Changeset 17

Show
Ignore:
Timestamp:
03/12/08 21:25:59 (8 months ago)
Author:
mwhitworth
Message:

fruity: Handle long lines in files by adding todo. Will address soon.

Location:
Whitix/trunk/user/fruity
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • Whitix/trunk/user/fruity/file.c

    r7 r17  
    6565} 
    6666 
     67#define BUF_SIZE        255 
     68 
    6769int FileReadIn(FILE* file) 
    6870{ 
     
    8284                        msDos=1; 
    8385                        continue; 
     86                } 
     87 
     88                if (len == BUF_SIZE) 
     89                { 
     90                        printf("Todo: Handle long lines (e.g. binary files)\n"); 
     91                        return 1; 
    8492                } 
    8593 
     
    104112} 
    105113 
    106 void ReadFile(char* fileName) 
     114int ReadFile(char* fileName) 
    107115{ 
     116        int ret=0; 
     117 
    108118        if (!fileName) 
    109119                return; 
     
    112122 
    113123        if (file) 
    114                 FileReadIn(file); 
     124                ret=FileReadIn(file); 
    115125        else 
    116126                NewFile(); 
     
    119129 
    120130        fclose(file); 
     131         
     132        return ret; 
    121133} 
    122134 
  • Whitix/trunk/user/fruity/file.h

    r7 r17  
    55void FileFree(); 
    66void NewFile(); 
    7 void ReadFile(char* fileName); 
     7int ReadFile(char* fileName); 
    88int SaveFile(char* fileName); 
    99 
  • Whitix/trunk/user/fruity/main.c

    r7 r17  
    686686 
    687687                /* And read it in */ 
    688                 ReadFile(fileName); 
     688                if (ReadFile(fileName)) 
     689                        return 0; 
    689690        }else 
    690691                NewFile();