1 /* 2 * Grace - GRaphing, Advanced Computation and Exploration of data 3 * 4 * Home page: http://plasma-gate.weizmann.ac.il/Grace/ 5 * 6 * Copyright (c) 1991-1995 Paul J Turner, Portland, OR 7 * Copyright (c) 1996-2000 Grace Development Team 8 * 9 * Maintained by Evgeny Stambulchik 10 * 11 * 12 * All Rights Reserved 13 * 14 * This program is free software; you can redistribute it and/or modify 15 * it under the terms of the GNU General Public License as published by 16 * the Free Software Foundation; either version 2 of the License, or 17 * (at your option) any later version. 18 * 19 * This program is distributed in the hope that it will be useful, 20 * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 * GNU General Public License for more details. 23 * 24 * You should have received a copy of the GNU General Public License 25 * along with this program; if not, write to the Free Software 26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 27 */ 28 29 /* 30 * File I/O 31 */ 32 33 #ifndef __FILES_H_ 34 #define __FILES_H_ 35 36 #include <stdio.h> 37 38 /* data load types */ 39 #define LOAD_SINGLE 0 40 #define LOAD_NXY 1 41 #define LOAD_BLOCK 2 42 43 int add_io_filter( int type, int method, char *id, char *comm ); 44 int add_input_filter( int method, char *id, char *comm ); 45 int add_output_filter( int method, char *id, char *comm ); 46 void clear_io_filters( int f ); 47 FILE *filter_read( char *fn ); 48 FILE *filter_write( char *fn ); 49 50 char *grace_path(char *fn); 51 char *grace_exe_path(char *fn); 52 53 FILE *grace_openw(char *fn); 54 FILE *grace_openr(char *fn, int src); 55 void grace_close(FILE *fp); 56 57 int getparms(char *plfile); 58 int getdata(int gno, char *fn, int src, int type); 59 int update_set_from_file(int gno, int setno, char *fn, int src); 60 61 int readblockdata(int gno, char *fn, FILE * fp); 62 63 int load_project_file(char *fn, int as_template); 64 65 int new_project(char *template); 66 int load_project(char *fn); 67 int save_project(char *fn); 68 69 int write_set(int gno, int setno, FILE *cp, char *format, int rawdata); 70 void outputset(int gno, int setno, char *fname, char *dformat); 71 72 int readnetcdf(int gno, 73 int setno, 74 char *netcdfname, 75 char *xvar, 76 char *yvar, 77 int nstart, 78 int nstop, 79 int nstride); 80 int write_netcdf(char *fname); 81 82 char *grace_fgets(char *s, int size, FILE *stream); 83 84 85 #endif /* __FILES_H_ */ 86