/* SLANG_INTP_TYPE */ static int intp_push (SLtype unused, VOID_STAR ptr) { int *addr; (void) unused; addr = *(int **)ptr; if (addr == NULL) return SLclass_push_int_obj (SLANG_INT_TYPE, 0); return SLclass_push_int_obj (SLANG_INT_TYPE, *addr); }
int _pSLcall_bos_handler (SLFUTURE_CONST char *file, int line) { int status = 0; int err; if (BOS_Callback_Handler == NULL) return 0; if (Handler_Active) return 0; if ((0 != (err = _pSLang_Error)) && (-1 == _pSLang_push_error_context ())) return -1; Handler_Active++; if ((-1 == SLang_start_arg_list ()) || (-1 == SLang_push_string (file)) || (-1 == SLclass_push_int_obj (SLANG_INT_TYPE, line)) || (-1 == SLang_end_arg_list ()) || (-1 == SLexecute_function (BOS_Callback_Handler))) { set_bos_eos_handlers (NULL, NULL); status = -1; } Handler_Active--; if (err) _pSLang_pop_error_context (status != 0); return status; }
/* int _pSLcall_debug_hook (char *file, int line, char *funct) */ int _pSLcall_debug_hook (SLFUTURE_CONST char *file, int line) { int status = 0, err; if (Debug_Hook == NULL) return 0; if (Debug_Handler_Active) return 0; if ((0 != (err = _pSLang_Error)) && (-1 == _pSLang_push_error_context ())) return -1; Debug_Handler_Active++; if ((-1 == SLang_start_arg_list ()) || (-1 == SLang_push_string (file)) || (-1 == SLclass_push_int_obj (SLANG_INT_TYPE, line)) || (-1 == SLang_end_arg_list ()) || (-1 == SLexecute_function (Debug_Hook))) { status = -1; set_debug_hook (NULL); } Debug_Handler_Active--; if (err) (void) _pSLang_pop_error_context (status != 0); return status; }
int SLang_push_datatype (SLtype data_type) { /* This data type could be a copy of another type, e.g., short and * int if they are the same size (Int16 == Short). So, make sure * we push the original and not the copy. */ data_type = _pSLclass_get_class (data_type)->cl_data_type; return SLclass_push_int_obj (SLANG_DATATYPE_TYPE, data_type); }
int SLang_push_uint (unsigned int i) { return SLclass_push_int_obj (SLANG_UINT_TYPE, (int) i); }
int SLang_push_int (int i) { return SLclass_push_int_obj (SLANG_INT_TYPE, i); }
/* Note that integer literals are all stored in the byte-code as longs. This * is why it is necessary to use *(long*). */ static int push_int_literal (SLtype type, VOID_STAR ptr) { return SLclass_push_int_obj (type, (int) *(long *) ptr); }