12 #include "../stdafx.h"
14 #include <sqstdmath.h>
17 #include "../core/alloc_func.hpp"
18 #include "../core/math_func.hpp"
19 #include "../string_func.h"
21 #include "../safeguards.h"
28 sq_getinteger(vm, 2, &tmp1);
29 sq_getinteger(vm, 3, &tmp2);
30 sq_pushinteger(vm, ::
min(tmp1, tmp2));
38 sq_getinteger(vm, 2, &tmp1);
39 sq_getinteger(vm, 3, &tmp2);
40 sq_pushinteger(vm, ::
max(tmp1, tmp2));
46 SQInteger top = sq_gettop(vm);
47 const SQChar *filename;
49 sq_getstring(vm, 2, &filename);
53 sq_stackinfos(vm, 1, &si);
54 if (si.source == NULL) {
55 DEBUG(misc, 0,
"[squirrel] Couldn't detect the script-name of the 'require'-caller; this should never happen!");
62 SQChar *s = strrchr(path, PATHSEPCHAR);
69 #if (PATHSEPCHAR != '/')
70 for (
char *n = path; *n !=
'\0'; n++)
if (*n ==
'/') *n = PATHSEPCHAR;
79 return ret ? 0 : SQ_ERROR;
86 if (sq_gettop(vm) >= 1) {
87 if (SQ_SUCCEEDED(sq_getbool(vm, -1, &b))) {
88 sq_notifyallexceptions(vm, b);
111 sqstd_register_mathlib(engine->
GetVM());