int getdata(Quark *gr, char *fn, int settype, int load_type) { FILE *fp; int retval; GraceApp *gapp = gapp_from_quark(gr); ascii_data adata; fp = gapp_openr(gapp, fn, SOURCE_DISK); if (fp == NULL) { return RETURN_FAILURE; } adata.label = fn; adata.load_type = load_type; adata.settype = settype; retval = uniread(gr, fp, NULL, store_cb, &adata); gapp_close(fp); if (load_type != LOAD_BLOCK) { autoscale_graph(gr, gapp->rt->autoscale_onread); } return retval; }
void define_autos(int aon, int au, int ap, int ameth, int antx, int anty) { int i, ming, maxg; if (au >= 0 && !isactive_set(cg, au)) { errmsg("Set not active"); return; } if (ap) { ming = 0; maxg = maxgraph - 1; } else { ming = cg; maxg = cg; } if (ming == cg && maxg == cg) { if (!isactive_graph(cg)) { errmsg("Current graph is not active!"); return; } } for (i = ming; i <= maxg; i++) { if (isactive_graph(i)) { if (ameth == 0) { g[i].auto_type = TYPE_AUTO; } else { g[i].auto_type = TYPE_SPEC; } g[i].t[0].t_num = antx + 2; g[i].t[1].t_num = anty + 2; if (aon > -4) { /* -4 == just set parameters but don't * autoscale */ if (au >= 0 && isactive_set(i, au)) { autoscale_set(i, au, aon); } else { autoscale_graph(i, aon); } } } } if (aon != -4) { #ifndef NONE_GUI drawgraph(); #endif } }