include include define MSIZE 4. define KEY "fos$y_calib/flatfield/spcurhelp.key" define PROMPT "cursor options" # SPCURS -- Plotting and cursor interaction for flatfield spline fitting procedure spcurs( gp, gt, xnode, dnode, nodes, status ) pointer gp # i: gio pointer pointer gt # i: gtools pointer double xnode[ARB] # io: x positions of spline nodes double dnode[ARB] # io: y positions of spline nodes int nodes # io: number of spline nodes int status # o: return status pointer sp, cmd int wcs, key, newgraph int gt_gcur1() real wx, wy begin # allocate memory call smark (sp) call salloc( cmd, SZ_LINE, TY_CHAR) status = gt_gcur1(gt, "cursor", wx, wy, wcs, key, Memc[cmd], SZ_LINE) # If an EOF was typed, the set status to -1 and exit routine. if (status == EOF) { call sfree(sp) status = -1 return } # Set the exit status to 0 and loop over cursor input. If 'e' is typed # to signal 'evaluate' then set return to calling routine with status 0 status = 0 repeat{ switch (key) { case '?': # Print help text call gpagefile( gp, KEY, PROMPT ) status = 0 case ':': # List or set parameters if (Memc[cmd] == '/') call gt_colon( Memc[cmd], gp, gt, newgraph) status = 0 case 'a': # Add nodes call spaddn(gp, wx, wy, xnode, dnode, nodes) status = 0 case 'd': # Delete nodes call spdeln(gp, gt, xnode, dnode, nodes, wx, wy) status = 0 case 'e': # Evaluate the spline with new nodes status = 0 break } status = gt_gcur1(gt,"cursor",wx,wy,wcs,key,Memc[cmd],SZ_LINE) } until ( status == EOF ) if (status == EOF) status = -1 call sfree(sp) end