1 /* Copyright (C) 1992-1998 The Geometry Center 2 * Copyright (C) 1998-2000 Stuart Levy, Tamara Munzner, Mark Phillips 3 * 4 * This file is part of Geomview. 5 * 6 * Geomview is free software; you can redistribute it and/or modify it 7 * under the terms of the GNU Lesser General Public License as published 8 * by the Free Software Foundation; either version 2, or (at your option) 9 * any later version. 10 * 11 * Geomview is distributed in the hope that it will be useful, but 12 * WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public 17 * License along with Geomview; see the file COPYING. If not, write 18 * to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, 19 * USA, or visit http://www.gnu.org. 20 */ 21 22 23 /* Authors: Stuart Levy, Tamara Munzner, Mark Phillips */ 24 25 #ifndef COMM_H 26 #define COMM_H 27 28 /* 29 * comm_object() interprets a string to yield an object. 30 * If the string is exactly the name of a file, open & read the file, 31 * otherwise interpret it as something in that object's syntax. 32 * The 'now' flag determines whether the file must be read immediately. 33 * COMM_NOW returns failure (0) if an object can't immediately be 34 * read from the file. It reads at most one object from the file, 35 * then closes it. If trying to guess the type of a file, 36 * you MUST use COMM_NOW. 37 * COMM_LATER reads an object if it can, but returns failure only 38 * if a file can't be opened. However, it leaves the file open and 39 * listening for further data. If opening something other than a plain 40 * file e.g. a named pipe, you MUST use COMM_LATER. 41 */ 42 43 #define COMM_NOW 1 44 #define COMM_LATER 0 45 46 extern HandleOps CommandOps, TransOps, NTransOps, GeomOps, CamOps, WindowOps; 47 48 extern void comm_init(); 49 50 extern int comm_object(char *str, HandleOps *, Handle **hp, Ref **rp, int now); 51 52 extern int comm_read(char *kind, Pool *p); 53 extern int comm_route(char *str); /* interpret str as command */ 54 extern void gv_merge(HandleOps *ops, int id, Ref *window_or_camera); 55 56 /* Maps string 'commands/geometry/transform/camera' 57 * into a HandleOps pointer, or NULL. 58 * Allows abbreviations. 59 */ 60 extern HandleOps *str2ops(char *name); 61 62 extern void loadfile(char *filename, HandleOps *defaultops, int guess); 63 extern emodule *emodule_run(emodule *em); 64 extern int emodule_kill(emodule *em); 65 extern void emodule_reap(emodule *em); 66 67 extern int gv_debug; 68 69 #endif /* ! COMM_H */ 70