Ejemplo n.º 1
0
int SLang_init_signal (void)
{
   Signal_Type *s;

   if ((-1 == SLadd_intrin_fun_table(Intrin_Table, NULL))
       || (-1 == SLadd_iconstant_table (IConsts, NULL)))
     return -1;

   s = Signal_Table;
   while (s->name != NULL)
     {
	if (-1 == SLns_add_iconstant (NULL, s->name, SLANG_INT_TYPE, s->sig))
	  return -1;

	s++;
     }

   return 0;
}
Ejemplo n.º 2
0
static int new_exception_hook (SLFUTURE_CONST char *name, SLFUTURE_CONST char *desc, int err_code)
{
   SLang_IConstant_Type *ic;

   (void) desc;
   if (NULL != (ic = (SLang_IConstant_Type *)_pSLlocate_name (name)))
     {
	if ((ic->name_type != SLANG_ICONSTANT)
	    || (ic->value != err_code))
	  {
	     _pSLang_verror (SL_RunTime_Error, "Exception %s already exists and may not be redefined", name);
	     return -1;
	  }
	return 0;
     }

   if (-1 == SLns_add_iconstant (NULL, name, SLANG_INT_TYPE, err_code))
     return -1;

   return 0;
}
static int register_new_datatype (SLFUTURE_CONST char *name, SLtype type)
{
   return SLns_add_iconstant (NULL, name, SLANG_DATATYPE_TYPE, type);
}