]> gitweb.factorcode.org Git - factor.git/blob - vm/os-genunix.cpp
Merge branch 'for-slava' of git://git.rfc1149.net/factor
[factor.git] / vm / os-genunix.cpp
1 #include "master.hpp"
2
3 namespace factor
4 {
5
6 void factor_vm::c_to_factor_toplevel(cell quot)
7 {
8         c_to_factor(quot,this);
9 }
10
11 void init_signals()
12 {
13         unix_init_signals();
14 }
15
16 void early_init() { }
17
18 #define SUFFIX ".image"
19 #define SUFFIX_LEN 6
20
21 /* You must delete[] the result yourself. */
22 const char *default_image_path()
23 {
24         const char *path = vm_executable_path();
25
26         if(!path)
27                 return "factor.image";
28
29         int len = strlen(path);
30         char *new_path = new char[PATH_MAX + SUFFIX_LEN + 1];
31         memcpy(new_path,path,len + 1);
32         memcpy(new_path + len,SUFFIX,SUFFIX_LEN + 1);
33         free(const_cast<char *>(path));
34         return new_path;
35 }
36
37 }