/home/coin/SVN-release/Cgl-0.52.0/DyLP/src/DylpStdLib/dylib_io.h

Go to the documentation of this file.
00001 #ifndef _DYLIB_IO_H
00002 #define _DYLIB_IO_H
00003 
00004 /*
00005   This file is part of the support library for the Dylp LP distribution.
00006 
00007         Copyright (C) 2005 -- 2007 Lou Hafer
00008 
00009         School of Computing Science
00010         Simon Fraser University
00011         Burnaby, B.C., V5A 1S6, Canada
00012         lou@cs.sfu.ca
00013 
00014   This code is licensed under the terms of the Common Public License (CPL).
00015 */
00016 
00017 /*
00018   @(#)io.h      2.4     03/18/04
00019   svn/cvs: $Id: dylib_io.h 148 2007-06-09 03:15:30Z lou $
00020 */
00021 
00022 #include "dylib_std.h"
00023 #ifdef _DYLIB_FORTRAN
00024 #include "dylib_fortran.h"
00025 #endif
00026 
00027 
00028 /*
00029   Common definitions for the i/o library packages.
00030 */
00031 
00032 /*
00033   The file i/o routines in io.c use an integer i/o id to specify a stream.
00034   The only reason to have this typedef is clarity in the code (and the off
00035   chance that it might someday become a more complex type). i/o id's are
00036   positive integers, between 1 and FOPEN_MAX-2 (see io.c for details).
00037 */
00038 
00039 typedef int ioid ;
00040 
00041 #define IOID_NOSTRM ((ioid) 0)
00042 #define IOID_INV ((ioid) -1)
00043 
00044 /*
00045   The lexeme structure, used for strings.
00046   
00047   Field         Description
00048   -----         -----------
00049   class         The class of the lexeme.
00050   string        The value of the lexeme.
00051 
00052   The values for class are drawn from the following set, defined below as the
00053   enum lexclass.
00054 
00055   Value         Description
00056   -----         -----------
00057   LCNIL         Null lexeme.
00058   LCNUM         A number.
00059   LCID          An identifier.
00060   LCDEL         A delimiter.
00061   LCFS          A fixed-length string.
00062   LCQS          A quoted string.
00063   LCEOF         Indicates end-of-file while trying to assemble a lexeme.
00064   LCERR         Indicates I/O error while trying to assemble a lexeme.
00065 */
00066 
00067 typedef enum {LCNIL,LCNUM,LCID,LCDEL,LCFS,LCQS,LCEOF,LCERR} lexclass ;
00068 
00069 #ifdef  __cplusplus
00070 typedef struct { lexclass clazz ;
00071                  char *string ; } lex_struct ;
00072 #else
00073 typedef struct { lexclass class ;
00074                  char *string ; } lex_struct ;
00075 #endif
00076 
00077 extern bool dyio_ioinit(void) ;
00078 extern void dyio_ioterm(void) ;
00079 
00080 extern ioid dyio_openfile(const char *path, const char *mode) ;
00081 extern bool dyio_isactive(ioid id) ;
00082 extern bool dyio_closefile(ioid id) ;
00083 extern bool dyio_setmode(ioid id, char mode), dyio_ttyq(ioid id) ;
00084 
00085 extern bool dyio_chgerrlog(const char *path, bool echo) ;
00086 
00087 extern const char *dyio_idtopath(ioid id) ;
00088 extern ioid dyio_pathtoid(const char *path, const char *mode) ;
00089 
00090 extern long dyio_mark(ioid id) ;
00091 extern bool dyio_backup(ioid id, long there) ;
00092 
00093 extern bool dyio_scan(ioid id, const char pattern[], bool rwnd, bool wrap) ;
00094 extern lex_struct *dyio_scanlex(ioid id),
00095                   *dyio_scanstr(ioid id, lexclass stype,
00096                                 int fslen, char qschr, char qechr) ;
00097 
00098 extern void dyio_flushio(ioid id, bool echo),
00099             dyio_outfmt(ioid id, bool echo, const char *pattern, ... ),
00100             dyio_outchr(ioid id, bool echo, char chr) ;
00101 extern int dyio_outfxd(char *buffer, int fldsze, char lcr,
00102                        const char *pattern, ... ) ;
00103 
00104 #ifdef _DYLIB_FORTRAN
00105 extern void dyio_outfmt_(integer *ftnid,
00106                          logical *ftnecho, char *pattern, ... ) ;
00107 #endif
00108 
00109 #endif /* _DYLIB_IO_H */

Generated on Fri May 16 19:27:10 2008 for coin-Cgl by  doxygen 1.4.7