bricolages...
This commit is contained in:
3
code/.gitignore
vendored
3
code/.gitignore
vendored
@@ -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
10
code/C/Makefile
Normal 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
20
code/C/slowprint.c
Normal 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;
|
||||
}
|
||||
@@ -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
15
code/awk/mkunion.awk
Normal file → Executable 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 {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user