+ voirenv

This commit is contained in:
tTh 2022-09-12 01:39:21 +02:00
parent f79ae3ef80
commit 73a611e55f
3 changed files with 49 additions and 0 deletions

21
code/.gitignore vendored Normal file
View File

@ -0,0 +1,21 @@
a.out
appelant
arguments
ex_curses
fifo-rx
fifo-tx
flydraw.gif
flydraw.png
foo
get-signal
hello
listen-osc
no-op
*.o
plugiciel.so
send-osc
thread-demo
voirenv
xform/yesyno

View File

@ -19,6 +19,9 @@ arguments: arguments.c Makefile
no-op: no-op.c Makefile
gcc -Wall $< -o $@
voirenv: voirenv.c Makefile
gcc -Wall $< -o $@
#------------- OSC -----------------------
osc: send-osc listen-osc

25
code/voirenv.c Normal file
View File

@ -0,0 +1,25 @@
/*
* Low level acces to the environment space
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[], char *envp[])
{
char *ptr, *clone, *tok;
int foo = 0;
while ( NULL != (ptr=envp[foo]) ) {
printf("%4d %s\n", foo, ptr);
clone = strdup(ptr);
tok = strtok(clone, "=");
printf(" key : %s\n", tok);
tok = strtok(NULL, "=");
printf(" value : %s\n", tok);
free(clone);
foo++;
}
return 0;
}