}
#endif
- gchar *profile = NULL;
gchar *conf = NULL;
int c = 0;
while (c != -1) {
static struct option long_options[] = {
{"conf", required_argument, 0, 'c' },
- {"profile", required_argument, 0, 'p' },
{"additional", required_argument, 0, 'a' },
{0, 0, 0, 0 }
};
set_variable("conf", optarg, true);
conf = g_strdup(optarg);
break;
- case 'p':
- set_variable("profile", optarg, true);
- profile = g_strdup(optarg);
- break;
case 'a':
// TODO: additional options should be accepted
set_variable("additional", optarg, true);
}
}
- if (!profile && !conf) {
- fprintf(stderr, "Usage: %s {-c|--conf} conf_file ...\n"
- " %s {-p|--profile} profile ...\n",
- basename(argv[0]), basename(argv[0]));
+ if (!conf) {
+ fprintf(stderr, "Usage: %s {-c|--conf} conf_file ...\n",
+ basename(argv[0]));
return -1;
}
- // load profile configurations
+ // load configurations
_qemu_argc = 0;
_qemu_argv[_qemu_argc++] = g_strdup(argv[0]);
set_bin_path(_qemu_argv[0]);
- if (!load_profile_default(conf, profile)) {
+ if (!load_conf(conf)) {
return -1;
}
}
// assemble arguments for qemu and skin
- if (!assemble_profile_args(&_qemu_argc, _qemu_argv,
+ if (!assemble_emulator_args(&_qemu_argc, _qemu_argv,
&_skin_argc, _skin_argv)) {
return -1;
}
*/
#include <string.h>
+#include <assert.h>
#include "qemu/queue.h"
#include "emulator_options.h"
if(!value) {
fprintf(stderr, "[%s] is not set."
" Please input value using commandline argument"
- " \"--%s\" or profile default file or envirionment"
+ " \"--%s\" or conf file or envirionment"
" variable.\n", name, name);
value = (char *)"";
set_variable(name, value, false);
return str;
}
-bool load_profile_default(const char * const conf, const char * const profile)
+bool load_conf(const char * const conf)
{
int classification = 0;
char str[LINE_LIMIT];
char *filename;
FILE *file = NULL;
- // if "conf" is exist, ignore "profile"
+ assert(!!conf);
if (conf) {
filename = g_strdup(conf);
- } else {
- filename = g_strdup_printf("%s/%s.conf", get_bin_path(), profile);
}
file = fopen(filename, "r");
return true;
}
-bool assemble_profile_args(int *qemu_argc, char **qemu_argv,
+bool assemble_emulator_args(int *qemu_argc, char **qemu_argv,
int *skin_argc, char **skin_argv)
{
if (!assemble_args(qemu_argc, qemu_argv,
void set_variable(const char * const arg1, const char * const arg2, bool override);
char *get_variable(const char * const name);
void reset_variables(void);
-bool load_profile_default(const char * const conf, const char * const profile);
-bool assemble_profile_args(int *qemu_argc, char **qemu_argv,
+bool load_conf(const char * const conf);
+bool assemble_emulator_args(int *qemu_argc, char **qemu_argv,
int *skin_argc, char **skin_argv);
#endif /* __EMULATOR_OPTIONS_H__ */