bricolages...

This commit is contained in:
tTh
2023-02-11 12:19:00 +01:00
parent 43202ab62e
commit a47c1f6d7a
10 changed files with 89 additions and 22 deletions

3
code/.gitignore vendored
View File

@@ -12,7 +12,8 @@ foo
get-signal
hello
listen-osc
no-op
C/no-op
C/slowprint
*.o
plugiciel.so
send-osc

10
code/C/Makefile Normal file
View File

@@ -0,0 +1,10 @@
# exemples pour le chapitre sur le C
# new Sat Feb 11 12:06:34 CET 2023
no-op: no-op.c Makefile
gcc -Wall $< -o $@
slowprint: slowprint.c Makefile
gcc -Wall $< -o $@

20
code/C/slowprint.c Normal file
View File

@@ -0,0 +1,20 @@
#include <stdio.h>
#include <time.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
int c;
struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = 115 * 1000 * 1000;
while ( EOF != (c=getchar()) )
{
putchar(c);
fflush(stdout);
nanosleep(&ts, NULL);
}
return 0;
}

View File

@@ -16,9 +16,6 @@ hello: hello.c Makefile
arguments: arguments.c Makefile
gcc -Wall $< -o $@
no-op: no-op.c Makefile
gcc -Wall $< -o $@
voirenv: voirenv.c Makefile
gcc -Wall $< -o $@

15
code/awk/mkunion.awk Normal file → Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/awk -f
BEGIN {
print "#declare Bubules = object"
print "{ \nunion { "
}
{
printf(" sphere { <%f, %f, %f>, %f }\n", \
$1, $2, $3, $4 )
}
END {
}