/*******************************************************/ /* "C" Language Integrated Production System */ /* */ /* CLIPS Version 6.40 10/19/17 */ /* */ /* FILE I/O ROUTER HEADER FILE */ /*******************************************************/ /*************************************************************/ /* Purpose: I/O Router routines which allow files to be used */ /* as input and output sources. */ /* */ /* Principal Programmer(s): */ /* Gary D. Riley */ /* */ /* Contributing Programmer(s): */ /* */ /* Revision History: */ /* */ /* 6.24: Added environment parameter to GenClose. */ /* Added environment parameter to GenOpen. */ /* */ /* Added pragmas to remove compilation warnings. */ /* */ /* 6.30: Removed conditional code for unsupported */ /* compilers/operating systems (IBM_MCW, */ /* MAC_MCW, and IBM_TBC). */ /* */ /* Used gengetc and genungetchar rather than */ /* getc and ungetc. */ /* */ /* Replaced BASIC_IO and ADVANCED_IO compiler */ /* flags with the single IO_FUNCTIONS compiler */ /* flag. */ /* */ /* Added const qualifiers to remove C++ */ /* deprecation warnings. */ /* */ /* 6.40: Removed LOCALE definition. */ /* */ /* Pragma once and other inclusion changes. */ /* */ /* Added support for booleans with . */ /* */ /* Removed use of void pointers for specific */ /* data structures. */ /* */ /* Added flush, rewind, tell, and seek functions. */ /* */ /*************************************************************/ #ifndef _H_filertr #pragma once #define _H_filertr #include #define FILE_ROUTER_DATA 47 struct fileRouter { const char *logicalName; FILE *stream; struct fileRouter *next; }; struct fileRouterData { struct fileRouter *ListOfFileRouters; }; #define FileRouterData(theEnv) ((struct fileRouterData *) GetEnvironmentData(theEnv,FILE_ROUTER_DATA)) void InitializeFileRouter(Environment *); FILE *FindFptr(Environment *,const char *); bool OpenAFile(Environment *,const char *,const char *,const char *); bool CloseAllFiles(Environment *); bool CloseFile(Environment *,const char *); bool FindFile(Environment *,const char *,void *); bool FlushAllFiles(Environment *); bool FlushFile(Environment *,const char *); bool RewindFile(Environment *,const char *); long long TellFile(Environment *,const char *); bool SeekFile(Environment *,const char *,long,int); #endif /* _H_filertr */