adde Makefile
This commit is contained in:
parent
5153dced8b
commit
719a91ab24
5 changed files with 64 additions and 46 deletions
|
@ -1,45 +0,0 @@
|
|||
/* Simple backend for a Logo like tortoise drawer. */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static const int WIDTH = 10;
|
||||
static const int HEIGHT = 10;
|
||||
|
||||
static FILE*
|
||||
start_gnuplot() {
|
||||
FILE* output;
|
||||
int pipes[2];
|
||||
pid_t pid;
|
||||
|
||||
pipe(pipes);
|
||||
pid = fork();
|
||||
|
||||
if (!pid) {
|
||||
dup2 (pipes[0], STDIN_FILENO);
|
||||
execlp ("gnuplot", NULL);
|
||||
return; /* Not reached. */
|
||||
}
|
||||
|
||||
output = fdopen(pipes[1], "w");
|
||||
|
||||
fprintf (output, "set multiplot\n");
|
||||
fprintf (output, "set parametric\n");
|
||||
fprintf (output, "set xrange [-%d:%d]\n", WIDTH, WIDTH);
|
||||
fprintf (output, "set yrange [-%d:%d]\n", HEIGHT, HEIGHT);
|
||||
fprintf (output, "set size ratio -1\n");
|
||||
fprintf (output, "unset xtics\n");
|
||||
fprintf (output, "unset ytics\n");
|
||||
fflush (output);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
static FILE* global_output;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
global_output = start_gnuplot();
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue