#ifndef INOUT_H
#define INOUT_H

/*
 * WMM
 * Wave-matching method for mode analysis of dielectric waveguides
 * Manfred Lohmeyer 
 * University of Osnabrueck, Department of Physics
 * Barbarastrasse 7, D-49069 Osnabrueck, Germany
 * (1999)
 * Manfred Hammer
 * University of Twente, Faculty of Mathematical Sciences
 * P.O. Box 217, 7500AE Enschede, The Netherlands
 * (2002)
 */

/* 
 * inout.h
 * basic file input / output functions 
 */

/* write and read char, int, double - values from files,
   values must appear on separate lines, 
   maybe divided by comment lines, starting with '%' */

/* write comment */
void comment(char *c, FILE *dat);

/* write character */
void fputchar(char c, FILE *dat);

/* write int */
void fputint(int i, FILE *dat);

/* write double */
void fputdouble(double d, FILE *dat);

/* character input from file dat */
char fgetchar(FILE *dat);

/* integer input from file dat */
int fgetint(FILE *dat);

/* double input from file dat */
double fgetdouble(FILE *dat);

/* ----------------------------------------------------------- */

/* first and second digit of integer number 0<=i<=99 */
char dig10(int i);
char dig1(int i);

/* ----------------------------------------------------------- */

/* append double value to file name.xf; create if necessary */
void apptoxf(char *name, double x);

/* append (x,y)-pair to file name.xyf; create if necessary */
void apptoxyf(char *name, double x, double y);

#endif  // INOUT_H

