Esempio n. 1
0
int clip_ODBC_IN_FLOAT(ClipMachine* mp){
	char* str = _clip_parc(mp,1);
	if(str){
		_clip_retnd(mp,*((float*)str));
	}
	return 0;
}
Esempio n. 2
0
int
clip_FLOATVAL(ClipMachine * ClipMachineMemory)
{
   char *s = _clip_parc(ClipMachineMemory, 1);

   int len = _clip_parni(ClipMachineMemory, 2);

   int dec = _clip_parni(ClipMachineMemory, 3);

   if (!s)
   {
      _clip_retnd(ClipMachineMemory, 0);
      return 0;
   }
   if (strchr(s, 'e') || strchr(s, 'E'))
   {
      struct lconv *lc = localeconv();

      char c, *r;

      if (*lc->decimal_point == '.')
	 c = ',';
      else
	 c = '.';
      r = s;
      while ((r = strchr(r, c)))
	 *r = *lc->decimal_point;
      _clip_retndp(ClipMachineMemory, atof(s), len, dec);
      return 0;
   }
   return clip_VAL(ClipMachineMemory);
}
Esempio n. 3
0
int clip_ODBC_IN_DOUBLE(ClipMachine* mp){
	char* str = _clip_parc(mp,1);
	if(str){
		_clip_retnd(mp,*((double*)str));
	}
	return 0;
}
Esempio n. 4
0
int
clip_RAND(ClipMachine * mp)
{
	double ret= ((double) random()) / 0x7FFFFFFF;
	if ( ret < 0 )
		ret = 0-ret;
	_clip_retnd(mp, ret );
	return 0;
}
Esempio n. 5
0
/* Returns the current progress as a percentage. */
int
clip_GTK_PROGRESSGETCURRENTPERCENTAGE(ClipMachine * cm)
{
	C_widget *cprg = _fetch_cw_arg(cm);
        CHECKCWID(cprg,GTK_IS_PROGRESS);
        _clip_retnd(cm,gtk_progress_get_current_percentage(GTK_PROGRESS(cprg->widget)));
	return 0;
err:
	return 1;
}
Esempio n. 6
0
/* Returns the current progress complete value. */
int
clip_GTK_PROGRESSGETVALUE(ClipMachine * cm)
{
	C_widget    *cprg = _fetch_cw_arg(cm);
        CHECKCWID(cprg,GTK_IS_PROGRESS);
        _clip_retnd(cm,gtk_progress_get_value(GTK_PROGRESS(cprg->widget)));
	return 0;
err:
	return 1;
}
Esempio n. 7
0
int
clip_CTOF(ClipMachine * ClipMachineMemory)
{
   int SLen;

   char *S = _clip_parcl(ClipMachineMemory, 1, &SLen);

   _clip_retnd(ClipMachineMemory, *((double *) S));
   return 0;
}
Esempio n. 8
0
int
clip_GTK_LABELGETANGLE(ClipMachine * cm)
{
	C_widget *clbl = _fetch_cw_arg(cm);

	CHECKCWID(clbl,GTK_IS_LABEL);
	_clip_retnd(cm,gtk_label_get_angle(GTK_LABEL(clbl->widget)));
	return 0;
err:
	return 1;
}
Esempio n. 9
0
int
clip_GTK_SPINBUTTONGETCLIMBRATE(ClipMachine * ClipMachineMemory)
{
   C_widget *cspb = _fetch_cw_arg(ClipMachineMemory);

   CHECKCWID(cspb, GTK_IS_SPIN_BUTTON);
   _clip_retnd(ClipMachineMemory, GTK_SPIN_BUTTON(cspb->widget)->climb_rate);
   return 0;
 err:
   return 1;
}
Esempio n. 10
0
/* Retrieves the current value of a GtkSpinButton. */
int
clip_GTK_SPINBUTTONGETVALUE(ClipMachine * ClipMachineMemory)
{
   C_widget *cspb = _fetch_cw_arg(ClipMachineMemory);

   CHECKCWID(cspb, GTK_IS_SPIN_BUTTON);
   _clip_retnd(ClipMachineMemory, gtk_spin_button_get_value(GTK_SPIN_BUTTON(cspb->widget)));
   return 0;
 err:
   return 1;
}
Esempio n. 11
0
/* Returns the progress as a percentage calculated
 * from the supplied absolute progress value. */
int
clip_GTK_PROGRESSGETPERCENTAGEFROMVALUE(ClipMachine * cm)
{
	C_widget *cprg = _fetch_cw_arg(cm);
	gfloat   value = _clip_parnd(cm,2);
        CHECKCWID(cprg,GTK_IS_PROGRESS);
	CHECKOPT(2,NUMERIC_t);
        _clip_retnd(cm,gtk_progress_get_percentage_from_value(GTK_PROGRESS(cprg->widget),value));
	return 0;
err:
	return 1;
}
Esempio n. 12
0
int clip_PG_IN_INT8(ClipMachine* mp){
	PG_ROWSET* rowset = (PG_ROWSET*)_clip_fetch_c_item(
		mp,_clip_parni(mp,1),_C_ITEM_TYPE_SQL);
	char* str;
	int len;

	if(!rowset){
		_clip_trap_err(mp,0,0,0,subsys,ER_NOROWSET,er_norowset);
		return 1;
	}
	if(rowset->binary){
		str = _clip_parcl(mp,2,&len);
		if(str){
			_clip_retnd(mp,(double)*((long long*)str));
		}
	} else {
		str = _clip_parc(mp,2);
		if(str){
			_clip_retnd(mp,strtod(str,NULL));
		}
	}
	return 0;
}
Esempio n. 13
0
int
clip_INFINITY(ClipMachine * ClipMachineMemory)
{
#ifdef FLT_MAX
#else
#ifdef MAXFLOAT
#define FLT_MAX MAXFLOAT
#else
#ifdef FLOATMAX
#define FLT_MAX FLOATMAX
#else
#define FLT_MAX 3.40282347e+38F
#endif
#endif
#endif
   _clip_retnd(ClipMachineMemory, FLT_MAX);
   return 0;
}