static void _pgqinf (char *item) { char buf[1024]; int len; len = (int) sizeof(buf); cpgqinf (item, buf, &len); if (len < 0) len = 0; if (len >= (int) sizeof (buf)) len = sizeof (buf) - 1; buf[len] = 0; (void) SLang_push_string (buf); }
/** * This method opens a graphic panel for plotting. All the subsequent plotting will be put in this panel. * * @return The PGPLOT graphic Id just in case. */ int opengr() { char aux[8]; int i = 5; int GRid; cpgqinf("STATE", aux, &i); if (strncmp(aux, "OPEN", i) != 0) { GRid = cpgopen("/xwindow"); cpgask(0); resizemax(0.85); return (GRid); } else { fprintf(stderr, "Device alredy open !!"); return -1; } }