#ifndef INOUT_H #define INOUT_H /* * METRIC --- Mode expansion modeling in integrated optics / photonics * http://metric.computational-photonics.eu/ */ /* * inout.h * Basic file input / output functions */ #include /* 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(const 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); /* ----------------------------------------------------------- */ /* digits of integer numbers 0<=i<=999 */ char dig1000(int i); char dig100(int i); char dig10(int i); char dig1(int i); /* ----------------------------------------------------------- */ /* append double value to file name.xf; create if necessary */ void apptoxf(const char *name, double x); /* append (x, y)-pair to file name.xyf; create if necessary */ void apptoxyf(const char *name, double x, double y); /* append (x, y1, y2)-triple to file name.xyf; create if necessary */ void apptoxyf(const char *name, double x, double y1, double y2); #endif // INOUT_H