Begin hooking up functions and flow

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
This commit is contained in:
Ikey Doherty
2016-05-26 21:56:43 +01:00
parent 4e6f47368b
commit 54437d7122
3 changed files with 33 additions and 2 deletions
+13 -2
View File
@@ -9,22 +9,33 @@
* of the License, or (at your option) any later version.
*/
#include <assert.h>
#include <stdio.h>
#include "lsi.h"
bool lsi_config_load(__lsi_unused__ LsiConfig *config)
{
fputs("lsi_config_load(): Not yet implemented", stderr);
fputs("lsi_config_load(): Not yet implemented\n", stderr);
return false;
}
bool lsi_config_store(__lsi_unused__ LsiConfig *config)
{
fputs("lsi_config_store(): Not yet implemented", stderr);
fputs("lsi_config_store(): Not yet implemented\n", stderr);
return false;
}
void lsi_config_load_defaults(LsiConfig *config)
{
assert(config != NULL);
/* Very simple right now, but in future we'll expand the options and
* things that LSI knows about */
config->force_32 = false;
config->use_native_runtime = true;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
+5
View File
@@ -41,6 +41,11 @@ bool lsi_config_load(LsiConfig *config);
*/
bool lsi_config_store(LsiConfig *config);
/**
* Set the defaults for the LsiConfiguration
*/
void lsi_config_load_defaults(LsiConfig *config);
/**
* Determine if the host system is 64-bit.
*
+15
View File
@@ -9,12 +9,27 @@
* of the License, or (at your option) any later version.
*/
#include <stdio.h>
#include <stdlib.h>
#include "lsi.h"
int main(__lsi_unused__ int argc, __lsi_unused__ char **argv)
{
LsiConfig config = { 0 };
bool is_x86_64;
if (!lsi_config_load(&config)) {
lsi_config_load_defaults(&config);
}
is_x86_64 = lsi_system_is_64bit();
/* Debug printers */
fprintf(stderr, "emul32? %s\n", config.force_32 ? "yes" : "no");
fprintf(stderr, "native-runtime? %s\n", config.use_native_runtime ? "yes" : "no");
fprintf(stderr, "x86-64? %s\n", is_x86_64 ? "yes" : "no");
return EXIT_FAILURE;
}