int Plot_query_plot_limits (float *xmin, float *xmax, float *ymin, float *ymax) /*{{{*/ { if (pli_undefined()) return -1; if (PLI->query_plot_limits == NULL) { isis_vmesg (FAIL, I_FAILED, __FILE__, __LINE__, "plot: query_plot_limits operation is not supported"); return -1; } if (-1 == SLexecute_function (PLI->query_plot_limits)) { isis_vmesg (FAIL, I_FAILED, __FILE__, __LINE__, "failed querying plot limits"); return -1; } if ((-1 == SLang_pop_float (ymax)) || (-1 == SLang_pop_float (ymin)) || (-1 == SLang_pop_float (xmax)) || (-1 == SLang_pop_float (xmin))) { isis_vmesg (FAIL, I_FAILED, __FILE__, __LINE__, "failed querying plot limits"); return -1; } return 0; }
static int read_plot_cursor (Cursor_Config_Type *cc, float *x, float *y, char *ch) /*{{{*/ { if (pli_undefined()) return -1; if (PLI->read_cursor == NULL) { isis_vmesg (FAIL, I_FAILED, __FILE__, __LINE__, "plot: read_cursor operation is not supported"); return -1; } if (-1 == SLang_push_cstruct ((VOID_STAR)cc, Cursor_Config_Table)) return -1; if (-1 == SLexecute_function (PLI->read_cursor)) { isis_vmesg (FAIL, I_FAILED, __FILE__, __LINE__, "plot: read_cursor failed"); return -1; } if (SLstack_depth() < 3) { isis_vmesg (FAIL, I_ERROR, __FILE__, __LINE__, "plot: read_cursor failed"); return -1; } SLang_pop_char (ch); SLang_pop_float (y); SLang_pop_float (x); return 0; }
static void _pgconl (char *label, int *intval, int *minint) { float *a; unsigned int idim, jdim; int i_1, i_2, j_1, j_2; float c; SLang_Array_Type *tr, *at; tr = at = NULL; if (-1 == pop_float_vector (&tr)) return; if (-1 == SLang_pop_float (&c)) goto return_error; if (-1 == pop_4_ints (&j_1, &j_2, &i_1, &i_2)) goto return_error; if (NULL == (at = pop_2d_float_array (&a, &jdim, &idim))) goto return_error; /* Convert to FORTRAN indexing */ i_1++; j_1++; i_2++; j_2++; cpgconl (a, idim, jdim, i_1, i_2, j_1, j_2, c, (float *)tr->data, label, *intval, *minint); return_error: free_arrays (at, tr, NULL, NULL); }
static int pop_5_floats (float *x1, float *x2, float *x3, float *x4, float *x5) { if ((x5 != NULL) && (-1 == SLang_pop_float (x5))) return -1; if ((x4 != NULL) && (-1 == SLang_pop_float (x4))) return -1; if ((x3 != NULL) && (-1 == SLang_pop_float (x3))) return -1; if ((x2 != NULL) && (-1 == SLang_pop_float (x2))) return -1; if ((x1 != NULL) && (-1 == SLang_pop_float (x1))) return -1; return 0; }
static int pop_array_or_scalar (Array_Or_Scalar_Type *ast) { SLang_Array_Type *at; ast->at = NULL; ast->inc = 0; ast->num = 1; switch (SLang_peek_at_stack1 ()) { case -1: return -1; case SLANG_FLOAT_TYPE: ast->is_float = 1; if (SLang_peek_at_stack () == SLANG_ARRAY_TYPE) { if (-1 == SLang_pop_array_of_type (&at, SLANG_FLOAT_TYPE)) return -1; ast->fptr = (float *) at->data; ast->inc = 1; ast->num = at->num_elements; ast->at = at; return 0; } ast->fptr = &ast->f; if (-1 == SLang_pop_float (ast->fptr)) return -1; return 0; default: ast->is_float = 0; if (SLang_peek_at_stack () == SLANG_ARRAY_TYPE) { if (-1 == SLang_pop_array_of_type (&at, SLANG_DOUBLE_TYPE)) return -1; ast->dptr = (double *) at->data; ast->inc = 1; ast->num = at->num_elements; ast->at = at; return 0; } ast->dptr = &ast->d; if (-1 == SLang_pop_double (ast->dptr)) return -1; return 0; } }
static int float_pop (SLtype unused, VOID_STAR ptr) { (void) unused; return SLang_pop_float ((float *) ptr); }