/* Definition of Datalib and related types */ #ifndef MAX_NAME_LEN #define MAX_NAME_LEN 80 /* max len of dir entry */ typedef long int FilePtr; /* File pointer */ typedef Int4 FileLen; /* Length field */ typedef struct { /* Block descriptor; the block itself follows it */ FilePtr Next; /* Next Block in the chain */ FileLen Len; /* Length of the Block excluding its descriptor */ FileLen DataLen; /* Used for the last Block in a chain only */ } BlockDesc; typedef struct _DataLib { FILE PNTR Stream; /* Stream used to read/write the file */ CharPtr FileName; /* dynamic copy of DataLib file name */ /* Low-level routines data */ Int2 Flags; /* internal flags */ FilePtr CurBlockPtr; /* Current position: Block and */ FileLen CurOffset; /* offset in it */ BlockDesc CurDesc; /* The descriptor of the current Block */ FilePtr PrevBlockPtr; /* Previous Block pointer; used for overwriting */ /* Middle-level routines data */ FilePtr FirstDirPtr; /* Pointer to the first entry of the current subdirectory */ FilePtr CurDirPtr; /* Pointer to the current entry of the current subdirectory */ FilePtr ParentDirPtr; /* Pointer to the parent entry of the current directory */ Int2 PrevCurrent; /* Ordinal number of previous current dir entry */ Char DirName[MAX_NAME_LEN]; /* Name of the current directory entry */ #define NameFirstChar DirName[0] /* First character of the dir entry Name */ struct _DataLib PNTR Saved; /* by DataLibSavePos; used by DataLibRestorePos */ /* High-level routines data */ WindoW Window; /* DataLibShow window */ LisT List; /* DataLibShow list */ Int2 MinDepth; /* Depth is mesured from this value */ Int2 Depth; /* Depth of the current dir entry */ FilePtr SelectedDirPtr; /* Last Selected dir entry ptr */ } DataLib, PNTR DataLibPtr; typedef struct { /* DataLibTell/DataLibSeek */ FilePtr BlockPtr; /* Position: Block and */ FileLen Offset; /* offset from its beginning */ } DataLibPos, PNTR DataLibPosPtr; #endif /* MAX_NAME_LEN */