+ voirenv
This commit is contained in:
parent
f79ae3ef80
commit
73a611e55f
21
code/.gitignore
vendored
Normal file
21
code/.gitignore
vendored
Normal 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
|
@ -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
25
code/voirenv.c
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user