/home/coin/SVN-release/Osi-0.95.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 OsiDylp LP distribution.
00006 
00007         Copyright (C) 2005 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 program is free software; you can redistribute it and/or modify it
00015   under the terms of the GNU General Public License as published by the Free
00016   Software Foundation; either version 2 of the License, or (at your option)
00017   any later version.
00018 
00019   This program is distributed in the hope that it will be useful, but WITHOUT
00020   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00021   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
00022   more details.
00023 
00024   You should have received a copy of the GNU General Public License along
00025   with this program; if not, write to the Free Software Foundation, Inc.,
00026   51 Franklin St., Fifth Floor, Boston, MA  02110-1301  USA
00027 */
00028 
00029 /*
00030   @(#)io.h      2.4     03/18/04
00031   svn/cvs: $Id: dylib_io.h 94 2006-06-29 23:06:51Z lou $
00032 */
00033 
00034 #include "dylib_std.h"
00035 #ifdef _DYLIB_FORTRAN
00036 #include "dylib_fortran.h"
00037 #endif
00038 
00039 
00040 /*
00041   Common definitions for the i/o library packages.
00042 */
00043 
00044 /*
00045   The file i/o routines in io.c use an integer i/o id to specify a stream.
00046   The only reason to have this typedef is clarity in the code (and the off
00047   chance that it might someday become a more complex type). i/o id's are
00048   positive integers, between 1 and FOPEN_MAX-2 (see io.c for details).
00049 */
00050 
00051 typedef int ioid ;
00052 
00053 #define IOID_NOSTRM ((ioid) 0)
00054 #define IOID_INV ((ioid) -1)
00055 
00056 /*
00057   The lexeme structure, used for strings.
00058   
00059   Field         Description
00060   -----         -----------
00061   class         The class of the lexeme.
00062   string        The value of the lexeme.
00063 
00064   The values for class are drawn from the following set, defined below as the
00065   enum lexclass.
00066 
00067   Value         Description
00068   -----         -----------
00069   LCNIL         Null lexeme.
00070   LCNUM         A number.
00071   LCID          An identifier.
00072   LCDEL         A delimiter.
00073   LCFS          A fixed-length string.
00074   LCQS          A quoted string.
00075   LCEOF         Indicates end-of-file while trying to assemble a lexeme.
00076   LCERR         Indicates I/O error while trying to assemble a lexeme.
00077 */
00078 
00079 typedef enum {LCNIL,LCNUM,LCID,LCDEL,LCFS,LCQS,LCEOF,LCERR} lexclass ;
00080 
00081 #ifdef  __cplusplus
00082 typedef struct { lexclass clazz ;
00083                  char *string ; } lex_struct ;
00084 #else
00085 typedef struct { lexclass class ;
00086                  char *string ; } lex_struct ;
00087 #endif
00088 
00089 extern bool dyio_ioinit(void) ;
00090 extern void dyio_ioterm(void) ;
00091 
00092 extern ioid dyio_openfile(const char *path, const char *mode) ;
00093 extern bool dyio_isactive(ioid id) ;
00094 extern bool dyio_closefile(ioid id) ;
00095 extern bool dyio_setmode(ioid id, char mode), dyio_ttyq(ioid id) ;
00096 
00097 extern bool dyio_chgerrlog(const char *path, bool echo) ;
00098 
00099 extern const char *dyio_idtopath(ioid id) ;
00100 extern ioid dyio_pathtoid(const char *path, const char *mode) ;
00101 
00102 extern long dyio_mark(ioid id) ;
00103 extern bool dyio_backup(ioid id, long there) ;
00104 
00105 extern bool dyio_scan(ioid id, const char pattern[], bool rwnd, bool wrap) ;
00106 extern lex_struct *dyio_scanlex(ioid id),
00107                   *dyio_scanstr(ioid id, lexclass stype,
00108                                 int fslen, char qschr, char qechr) ;
00109 
00110 extern void dyio_flushio(ioid id, bool echo),
00111             dyio_outfmt(ioid id, bool echo, const char *pattern, ... ),
00112             dyio_outchr(ioid id, bool echo, char chr) ;
00113 extern int dyio_outfxd(char *buffer, int fldsze, char lcr,
00114                        const char *pattern, ... ) ;
00115 
00116 #ifdef _DYLIB_FORTRAN
00117 extern void dyio_outfmt_(integer *ftnid,
00118                          logical *ftnecho, char *pattern, ... ) ;
00119 #endif
00120 
00121 #endif /* _DYLIB_IO_H */

Generated on Fri May 16 00:05:01 2008 by  doxygen 1.4.7