libinput Generic way of gathering user commandline input
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m49s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m49s
This commit is contained in:
@@ -5,6 +5,8 @@ $(eval $(call add_lib,libprocess))
|
||||
$(eval $(call add_lib,libaux))
|
||||
$(eval $(call add_lib,libmalloc))
|
||||
$(eval $(call add_lib,libdebugconsole))
|
||||
$(eval $(call add_lib,libmalloc))
|
||||
$(eval $(call add_lib,libinput))
|
||||
|
||||
cflags += -DPRINTF_INCLUDE_CONFIG_H=1
|
||||
|
||||
|
||||
@@ -1,17 +1,30 @@
|
||||
#include <in_input.h>
|
||||
#include <mprintf.h>
|
||||
#include <process_self.h>
|
||||
#include <status.h>
|
||||
#include <string.h>
|
||||
#include <system.h>
|
||||
|
||||
#define COMMAND_MAX 32
|
||||
|
||||
static void start_part_dos (void) {
|
||||
char dev_name[64];
|
||||
|
||||
in_stream_read_line ("Device name: ", dev_name, sizeof (dev_name));
|
||||
}
|
||||
|
||||
void app_main (void) {
|
||||
libprocess_self_init ();
|
||||
|
||||
char commandbuf[COMMAND_MAX];
|
||||
commandbuf[0] = '\0';
|
||||
|
||||
if (env_get (process_get_pgid (), "C", (void*)commandbuf, sizeof (commandbuf)) == ST_OK) {
|
||||
mprintf ("C=%s\n", commandbuf);
|
||||
if (env_get (process_get_pgid (), "C", (void*)commandbuf, sizeof (commandbuf)) != ST_OK) {
|
||||
mprintf ("ERROR C=???. No command provided\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp (commandbuf, "part_dos") == 0) {
|
||||
start_part_dos ();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user