2026-06-20 15:29:32 +01:00
|
|
|
#include <fx/diagnostics/process.h>
|
2026-05-04 16:37:06 +01:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
2026-06-20 15:29:32 +01:00
|
|
|
int main(int argc, const char **argv)
|
2026-05-04 16:37:06 +01:00
|
|
|
{
|
2026-06-20 15:29:32 +01:00
|
|
|
printf("%d args:\n", argc);
|
2026-05-04 16:37:06 +01:00
|
|
|
|
2026-06-20 15:29:32 +01:00
|
|
|
for (int i = 0; i < argc; i++) {
|
|
|
|
|
printf("%s\n", argv[i]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
printf("environment:\n");
|
|
|
|
|
fx_process *self = fx_process_get_self();
|
|
|
|
|
const fx_hashtable *env = fx_process_get_environment(self);
|
|
|
|
|
fx_object_to_string(env, fx_stdout, NULL);
|
|
|
|
|
printf("\n");
|
|
|
|
|
|
|
|
|
|
printf("read from stdin...\n");
|
|
|
|
|
char line[128];
|
|
|
|
|
if (fgets(line, sizeof line, stdin)) {
|
|
|
|
|
printf("read: %s\n", line);
|
|
|
|
|
} else {
|
|
|
|
|
printf("read failed\n");
|
|
|
|
|
}
|
2026-05-04 16:37:06 +01:00
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|