acme
Foundational cross-platform layer of the ca2 framework
Toggle main menu visibility
Loading...
Searching...
No Matches
linux.h
1
#pragma once
2
3
4
#include "acme/operating_system.h"
5
6
7
8
9
//#ifdef LINUX
10
//
11
//extern ::i8 _binary__matter_zip_start[];
12
//extern ::i8 _binary__matter_zip_end[];
13
14
//#endif
15
16
//#ifndef __APP_ID
17
//
18
//
19
//#define __APP_ID ""
20
//
21
//
22
//#endif
23
24
template
<
typename
APPLICATION >
25
class
app_runner
26
{
27
public
:
28
29
30
class ::main * m_pmain;
31
::pointer<APPLICATION> m_papplication;
32
33
34
app_runner(::i32 argc, char_pointer argv[], char_pointer envp[], char_pointer res_start, char_pointer res_end)
35
{
36
37
m_pmain = memory_new class ::main;
38
39
m_pmain->m_argc = argc;
40
41
m_pmain->m_argv = argv;
42
43
m_pmain->m_envp = envp;
44
45
//m_pmain->m_strAppId = __APP_ID;
46
47
m_pmain->m_bConsole =
false
;
48
49
m_pmain->m_pchar_binary__matter_zip_start = res_start;
50
51
m_pmain->m_pchar_binary__matter_zip_end = res_end;
52
53
m_papplication = allocateø APPLICATION();
54
55
}
56
57
58
::i32 main()
59
{
60
61
__main(*m_pmain);
62
63
::i32 iExitCode = m_pmain->m_iExitCode;
64
65
return
iExitCode;
66
67
}
68
69
70
~app_runner()
71
{
72
73
m_papplication.release();
74
75
::acme::del(m_pmain);
76
77
}
78
79
80
};
81
82
83
//#define __start(argc, argv, envp) ____start _____start; class ::main main(argc, argv, envp)
84
//#define __run() __main(main)
85
//#define __end return main.m_iExitCode
86
87
//APPLICATION_CLASS g_app;
88
89
90
::i32
main
(::i32 argc, char_pointer argv[], char_pointer envp[])
91
{
92
93
auto
papp = allocateø APPLICATION_CLASS();
94
95
papp->set_args(argc, argv, envp);
96
97
#if defined(LINUX) || defined(FREEBSD) || defined(OPENBSD)
98
99
papp->m_pchar_binary__matter_zip_start = embed_resource::get_start();
100
101
papp->m_pchar_binary__matter_zip_end = embed_resource::get_end();
102
103
#endif
104
105
::i32 iExitCode = papp->main_loop();
106
107
return
iExitCode;
108
109
}
110
111
112
#endif
113
114
115
//app_runner < APPLICATION_CLASS > apprunner(argc, argv, envp, _binary__matter_zip_start, _binary__matter_zip_end);
116
117
118
//#ifdef CLASS_DECL_APEX
119
//
120
//
121
//#include "openssl/applink.c"
122
//
123
//
124
//#endif
125
126
127
main
Definition
aaa_acme.h:15
inline
application
linux.h
Generated by
1.17.0