/*---------------------------------------------------------------------------- File name : canvas.c Author : N. Devillard Created on : January 2001 Description : canvas for new ISAAC recipes. ---------------------------------------------------------------------------*/ /* $Id: canvas.c,v 1.3 2001/07/03 14:32:25 ndevilla Exp $ $Author: ndevilla $ $Date: 2001/07/03 14:32:25 $ $Revision: 1.3 $ */ /*---------------------------------------------------------------------------- Includes ---------------------------------------------------------------------------*/ /* Include here the files you need */ #include #include #include "eclipse.h" #include "isaacp_lib.h" /*--------------------------------------------------------------------------- Defines ---------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------- Macros ---------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------- New types ---------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------- Function codes ---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------- Main code ---------------------------------------------------------------------------*/ /* * This is the only public function, which prototype must remain fixed. * You will find out the command-line in the input dictionary and must * return an int: 0 if Ok, something else (usually -1) otherwise. */ int isaac_canvas_main(void * dict) { dictionary * d ; char name_i[FILENAMESZ]; char name_o[FILENAMESZ]; int nargs ; d = (dictionary*)dict ; /* Get input/output file names */ nargs = dictionary_getint(d, "arg.n", -1); if (nargs<0) { e_error("reading command-line arguments: aborting"); return -1 ; } strcpy(name_i, dictionary_get(d, "arg.1")); if (nargs>2) { strcpy(name_o, dictionary_get(d, "arg.2")); } else { strcpy(name_o, get_rootname(get_basename(name_i))); } /* * Once command-line options have been cleared out, call the main * computing function. */ return canvas_compute(name_i, name_o); } /* Main computing function. Do whatever you want from here on. */ static int canvas_compute(char * name_i, char * name_o) { e_comment(0, "got name_i=[%s]", name_i); e_comment(0, "got name_o=[%s]", name_o); return 0 ; }