Пример #1
0
int init_<MODULE-NAME>_module_ns (char *ns_name)
{
   SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name);
   if (ns == NULL)
     return -1;

   if ((-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL))
       || (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL))
       || (-1 == SLns_add_iconstant_table (ns, Module_Constants, NULL)))
     return -1;

   return 0;
}
Пример #2
0
int init_pgplot_module_ns (char *ns_name)
{
   SLang_NameSpace_Type *ns;

   if (NULL == (ns = SLns_create_namespace (ns_name)))
     return -1;

   if ((-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, "__PGPLOT__"))
       || (-1 == SLns_add_iconstant_table (ns, Module_IConstants, NULL))
       || (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL)))
     return -1;

   return setenv_pgplot_dir ();
}
Пример #3
0
int init_smg_module_ns (char *ns_name)
{
   SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name);
   if (ns == NULL)
     return -1;

   if ((-1 == SLns_add_intrin_fun_table (ns, Smg_Intrinsics, "__SMG__"))
       || (-1 == SLns_add_intrin_var_table (ns, Smg_Variables, NULL))
       || (-1 == SLns_add_iconstant_table (ns, Smg_Constants, NULL)))
     return -1;

   SLtt_get_terminfo ();
   Smg_Initialized = 0;
   return 0;
}
Пример #4
0
int init_miscio_module_ns (char *ns_name)
{
   SLang_NameSpace_Type *ns;
   SLang_NameSpace_Type *pub_ns;

   if (NULL == (ns = SLns_create_namespace (ns_name)))
     return isis_trace_return(-1);

   if (NULL == (pub_ns = SLns_create_namespace (Isis_Public_Namespace_Name)))
     return isis_trace_return(-1);

   if ((-1 == SLns_add_intrin_fun_table (ns, Misc_Intrinsics, NULL))
       || (-1 == SLns_add_intrin_var_table (pub_ns, Misc_Intrin_Vars, NULL))
       || (-1 == SLadd_intrin_var_table (Global_Intrin_Vars, NULL))
       || (-1 == SLns_add_iconstant_table (ns, Misc_Intrin_Const, NULL)))
     return isis_trace_return(-1);

   return 0;
}
Пример #5
0
int init_png_module_ns (char *ns_name)
{
   unsigned short x;

   SLang_NameSpace_Type *ns = SLns_create_namespace (ns_name);
   if (ns == NULL)
     return -1;

   x = 0xFF;
   Is_Little_Endian = (*(unsigned char *)&x == 0xFF);

   if (
       (-1 == SLns_add_intrin_var_table (ns, Module_Variables, NULL))
       || (-1 == SLns_add_intrin_fun_table (ns, Module_Intrinsics, NULL))
       || (-1 == SLns_add_iconstant_table (ns, Module_IConstants, NULL))
       )
     return -1;

   return 0;
}