示例#1
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;
}
示例#2
0
static void new_csv_encoder_intrin (void)
{
   CSV_Type *csv;
   SLang_MMT_Type *mmt;

   if (NULL == (csv = (CSV_Type *)SLmalloc(sizeof(CSV_Type))))
     return;
   memset ((char *)csv, 0, sizeof(CSV_Type));

   if ((-1 == SLang_pop_int (&csv->flags))
       ||(-1 == SLang_pop_char (&csv->quotechar))
       || (-1 == SLang_pop_char (&csv->delimchar))
       || (NULL == (mmt = SLang_create_mmt (CSV_Type_Id, (VOID_STAR)csv))))
     {
	free_csv_type (csv);
	return;
     }

   if (-1 == SLang_push_mmt (mmt))
     SLang_free_mmt (mmt);
}