Files

28 lines
556 B
C

#include <fx/diagnostics/process.h>
#include <stdio.h>
int main(int argc, const char **argv)
{
printf("%d args:\n", argc);
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");
}
return 0;
}