// ttt.h // // The source files in the "TTT" group support reading from the text database, and define the database format // // by John D. de Boer // This is a private header file for twhile.c, tttfield.c, tttitem.c and ttt.c. The file format // that it reads was formerly called "Twistory Text Type" and had the faux extension .ttt, although // they were always TEXT files. Now with extentions being meaningful in OS X, the extension is just .txt. // prototypes from twhile.c void PostFraction(real F); void PostCurrentFile(const char *S, real F); void PostMessage(const char *S, real F); void EndWait(void); void InitWait(void); // prototypes from tttfield.c string GetTTTFileName(const char *S); void repentity(char *S); enum { fNone, // unidentified or absent field identifier fName,fAka,fGeoRef, // fields for #city elements fRadius,fNation,fFlag, fRegion,fReplace, fColour,fWater, fFemale, // additional fields for #person elements fBorn,fDied,fTrans, fGeneration, fSurname, fMarriage,fFather,fMother, fPatAnc,fMatAnc, fCity,fOccup, fAcceded,fAbdicate, fAppointed,fDeposed, fElected,fRetired, fPower,fPromoted, fDepart,fArrive,fMove, fInfo,fRef,fPict,fCaption, fDate,fEnd,fType, // additional fields for #event elements fPerson, fPolygon, // additional fields for #sphere elements fIcon,fOff // additional fields for #item elements }; int FirstField(string *F, const char **S); void ParseDate(const char *S, bool AD, Day *D); void ParseRelDate(const char *S, const Day *A, Day *D); void ParseGeoRef(GeoRef *G, const char *S); void ParseColour(colour *C, const char *S); vectorpoly **ParsePolygon(const char *S, const FSRef *FSR); vectorpolys **ParsePolygons(const char *S, const FSRef *FSR); FSRef *NewPictureReference(const char *S, const FSRef *FSR); picture LoadImage(const char *S, const FSRef *FSR); void InitTTTFields(void); void PurgeTTTFields(void); // prototypes from tttitem.c void ParseElement(const char *S, const ParseDefaults *PD);