findinfile.c File Reference

#include "frontier.h"
#include "standard.h"
#include "error.h"
#include "memory.h"
#include "strings.h"
#include "file.h"
#include "lang.h"
#include "langinternal.h"

Include dependency graph for findinfile.c:

Go to the source code of this file.

Data Structures

struct  tyopenfile

Defines

#define filebuffersize   (32 * 1024)

Typedefs

typedef tyopenfileptropenfile
typedef tyopenfile ** hdlopenfile

Functions

static boolean loadbufferfromfile (hdlfilenum fnum, Handle hbuffer, long *ctbytes)
static boolean backupfilepos (hdlfilenum fnum, long ctbytes)
static void lowercasehandle (Handle h)
static boolean findopenfile (const tyfilespec *fs, hdlopenfile *hfile, hdlopenfile *hprev)
static void fifopenfileerror (const tyfilespec *fs)
static boolean fileopener (const tyfilespec *fs, hdlopenfile *hfile, hdlfilenum *fnum)
static boolean fileloadbuffer (hdlopenfile hf)
static void filecloser (hdlopenfile hfile, hdlfilenum fnum)
boolean fiffindinfile (const tyfilespec *fs, bigstring pattern, long *idx)
boolean fifcomparefiles (const tyfilespec *fs1, const tyfilespec *fs2)
boolean fifcharcounter (const tyfilespec *fs, char chlookfor, long *count)
boolean fifclosefile (const tyfilespec *fs)
boolean fifcloseallfiles (long refcon)
boolean fifopenfile (const tyfilespec *fs, long refcon)
boolean fifendoffile (const tyfilespec *fs)
static boolean fifread (const tyfilespec *fs, byte eolmarker, long ctmax, Handle *hdata)
boolean fifreadline (const tyfilespec *fs, Handle *linestring)
boolean fifreadhandle (const tyfilespec *fs, long ctbytes, Handle *x)
boolean fifreadfile (const tyfilespec *fs, Handle *x)
boolean fifwritehandle (const tyfilespec *fs, Handle x)
boolean fifwriteline (const tyfilespec *fs, Handle linestring)
boolean fifsetposition (const tyfilespec *fs, long pos)
boolean fifgetposition (const tyfilespec *fs, long *pos)
boolean fifsetendoffile (const tyfilespec *fs, long eof)
boolean fifgetendoffile (const tyfilespec *fs, long *eof)

Variables

hdlopenfile hfirstfile = nil


Define Documentation

#define filebuffersize   (32 * 1024)
 

Definition at line 40 of file findinfile.c.

Referenced by fifcomparefiles(), fifopenfile(), and fifsetposition().


Typedef Documentation

typedef struct tyopenfile ** hdlopenfile
 

typedef struct tyopenfile * ptropenfile
 


Function Documentation

static boolean backupfilepos hdlfilenum  fnum,
long  ctbytes
[static]
 

Definition at line 86 of file findinfile.c.

References filegetposition(), filesetposition(), and fl.

Referenced by fiffindinfile().

Here is the call graph for this function:

boolean fifcharcounter const tyfilespec fs,
char  chlookfor,
long count
 

Definition at line 469 of file findinfile.c.

References ct, fileopener(), tyopenfile::fs, tyopenfile::hbuffer, largefilebuffer(), loadbufferfromfile(), and nil.

Referenced by countlinesverb().

Here is the call graph for this function:

boolean fifcloseallfiles long  refcon  ) 
 

Definition at line 576 of file findinfile.c.

References fifclosefile(), tyopenfile::fs, hfirstfile, tyopenfile::nextfile, and nil.

Referenced by processruncode().

Here is the call graph for this function:

boolean fifclosefile const tyfilespec fs  ) 
 

Definition at line 542 of file findinfile.c.

References closefile(), disposehandle(), fifopenfileerror(), findopenfile(), tyopenfile::fs, hfirstfile, tyopenfile::nextfile, and nil.

Referenced by closefileverb(), fifcloseallfiles(), fifopenfile(), filefunctionvalue(), and readwholefileverb().

Here is the call graph for this function:

boolean fifcomparefiles const tyfilespec fs1,
const tyfilespec fs2
 

no more chars to look at

Definition at line 382 of file findinfile.c.

References filebuffersize, fileopener(), loadbufferfromfile(), newclearhandle(), and nil.

Referenced by comparefilesverb().

Here is the call graph for this function:

boolean fifendoffile const tyfilespec fs  ) 
 

Definition at line 663 of file findinfile.c.

References findopenfile(), and tyopenfile::fs.

Referenced by endoffileverb().

Here is the call graph for this function:

boolean fiffindinfile const tyfilespec fs,
bigstring  pattern,
long idx
 

Definition at line 254 of file findinfile.c.

References alllower(), backupfilepos(), fileopener(), tyopenfile::fpos, tyopenfile::fs, tyopenfile::hbuffer, largefilebuffer(), loadbufferfromfile(), lowercasehandle(), nil, and stringlength.

Referenced by findfileverb().

Here is the call graph for this function:

boolean fifgetendoffile const tyfilespec fs,
long eof
 

Definition at line 1053 of file findinfile.c.

References filecloser(), filegeteof(), fileopener(), fl, and tyopenfile::fs.

Referenced by getendoffileverb().

Here is the call graph for this function:

boolean fifgetposition const tyfilespec fs,
long pos
 

Definition at line 989 of file findinfile.c.

References tyopenfile::ctbufferbytes, fifopenfileerror(), filegetposition(), findopenfile(), and tyopenfile::fs.

Referenced by getmp3info(), and getpositionverb().

Here is the call graph for this function:

boolean fifopenfile const tyfilespec fs,
long  refcon
 

Definition at line 600 of file findinfile.c.

References disposehandle(), error, fifclosefile(), filebuffersize, filegeteof(), fileopener(), findopenfile(), tyopenfile::fs, tyopenfile::hbuffer, hfirstfile, newclearhandle(), and nil.

Referenced by filefunctionvalue(), openfileverb(), and readwholefileverb().

Here is the call graph for this function:

static void fifopenfileerror const tyfilespec fs  )  [static]
 

Definition at line 139 of file findinfile.c.

References bigstring, bsfunctionname, filenotopenederror, tyopenfile::fs, getfsfile(), and lang2paramerror().

Referenced by fifclosefile(), fifgetposition(), fifread(), fifreadfile(), and fifsetposition().

Here is the call graph for this function:

static boolean fifread const tyfilespec fs,
byte  eolmarker,
long  ctmax,
Handle hdata
[static]
 

Definition at line 678 of file findinfile.c.

References chlinefeed, chnul, chreturn, disposehandle(), fifopenfileerror(), fileloadbuffer(), findopenfile(), tyopenfile::fs, tyopenfile::ixbuffer, and nil.

Referenced by fifreadhandle(), and fifreadline().

Here is the call graph for this function:

boolean fifreadfile const tyfilespec fs,
Handle x
 

Definition at line 855 of file findinfile.c.

References disposehandle(), fifopenfileerror(), filegeteof(), fileread(), findopenfile(), fl, tyopenfile::fs, h, lockhandle(), newhandle(), nil, and unlockhandle().

Referenced by readwholefileverb().

Here is the call graph for this function:

boolean fifreadhandle const tyfilespec fs,
long  ctbytes,
Handle x
 

Definition at line 845 of file findinfile.c.

References chnul, fifread(), and tyopenfile::fs.

Referenced by getmp3info(), and readverb().

Here is the call graph for this function:

boolean fifreadline const tyfilespec fs,
Handle linestring
 

Definition at line 835 of file findinfile.c.

References chreturn, fifread(), tyopenfile::fs, and longinfinity.

Referenced by readlineverb().

Here is the call graph for this function:

boolean fifsetendoffile const tyfilespec fs,
long  eof
 

Definition at line 1018 of file findinfile.c.

References filecloser(), fileopener(), fileseteof(), fl, tyopenfile::fs, max, min, and nil.

Referenced by setendoffileverb().

Here is the call graph for this function:

boolean fifsetposition const tyfilespec fs,
long  pos
 

Definition at line 954 of file findinfile.c.

References tyopenfile::ctbytesleft, fifopenfileerror(), filebuffersize, filegeteof(), filesetposition(), findopenfile(), and tyopenfile::fs.

Referenced by getmp3info(), and setpositionverb().

Here is the call graph for this function:

boolean fifwritehandle const tyfilespec fs,
Handle  x
 

Definition at line 903 of file findinfile.c.

References filecloser(), filegeteof(), fileopener(), filesetposition(), filewrite(), fl, tyopenfile::fs, and gethandlesize().

Referenced by fifwriteline(), and writeverb().

Here is the call graph for this function:

boolean fifwriteline const tyfilespec fs,
Handle  linestring
 

Definition at line 934 of file findinfile.c.

References fifwritehandle(), tyopenfile::fs, and pushtexthandle().

Referenced by writelineverb().

Here is the call graph for this function:

static void filecloser hdlopenfile  hfile,
hdlfilenum  fnum
[static]
 

Definition at line 241 of file findinfile.c.

References closefile(), filesetposition(), and nil.

Referenced by fifgetendoffile(), fifsetendoffile(), and fifwritehandle().

Here is the call graph for this function:

static boolean fileloadbuffer hdlopenfile  hf  )  [static]
 

Definition at line 218 of file findinfile.c.

References loadbufferfromfile().

Referenced by fifread().

Here is the call graph for this function:

static boolean fileopener const tyfilespec fs,
hdlopenfile hfile,
hdlfilenum *  fnum
[static]
 

Definition at line 167 of file findinfile.c.

References disablelangerror(), enablelangerror(), filegetposition(), findopenfile(), fl, tyopenfile::fs, nil, openfile(), position, and setoserrorparam().

Referenced by fifcharcounter(), fifcomparefiles(), fiffindinfile(), fifgetendoffile(), fifopenfile(), fifsetendoffile(), and fifwritehandle().

Here is the call graph for this function:

static boolean findopenfile const tyfilespec fs,
hdlopenfile hfile,
hdlopenfile hprev
[static]
 

Definition at line 112 of file findinfile.c.

References equalfilespecs(), tyopenfile::fs, hfirstfile, tyopenfile::nextfile, and nil.

Referenced by fifclosefile(), fifendoffile(), fifgetposition(), fifopenfile(), fifread(), fifreadfile(), fifsetposition(), and fileopener().

Here is the call graph for this function:

static boolean loadbufferfromfile hdlfilenum  fnum,
Handle  hbuffer,
long ctbytes
[static]
 

Definition at line 69 of file findinfile.c.

References filereaddata(), fl, gethandlesize(), lockhandle(), and unlockhandle().

Referenced by fifcharcounter(), fifcomparefiles(), fiffindinfile(), and fileloadbuffer().

Here is the call graph for this function:

static void lowercasehandle Handle  h  )  [static]
 

Definition at line 106 of file findinfile.c.

References gethandlesize(), and lowertext().

Referenced by fiffindinfile().

Here is the call graph for this function:


Variable Documentation

hdlopenfile hfirstfile = nil
 

Definition at line 65 of file findinfile.c.

Referenced by fifcloseallfiles(), fifclosefile(), fifopenfile(), and findopenfile().


Generated on Thu Jun 1 10:42:52 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6