25 #include "pips_config.h"
42 #include "constants.h"
62 static char * command = NULL;
63 static int command_size = 0;
65 bool backslash_pending_p = FALSE;
69 if (command_size == 0) {
85 a_character, a_character);
86 if (a_character ==
'\n')
91 if (backslash_pending_p) {
92 backslash_pending_p = FALSE;
93 if (a_character ==
'n')
98 if (position == command_size - 2) {
101 command = realloc(command, command_size);
103 command[position++] = a_character;
107 command[position++] =
'\001';
108 command[position] =
'\0';
122 if (strcmp(command,
"ok\001")) {
128 if (sscanf(command,
"context(\"Context_%d\")\001",
135 if (sscanf(command,
"communication_error(\"%s\")\001",
138 "communication_error(\"%s\")",
buffer);
149 va_list some_arguments;
151 va_start(some_arguments, command_format);
153 va_end(some_arguments);
164 struct sigcontext * scp,
178 ( * old_SIGCHLD_handler)(sig,
code, scp, addr);
182 if (pid != 0 && (statusp & 255) != 127) {
184 pips_debug(5,
"daVinci pid %d exited with status %x\n",
201 int pips_output_fd[2], pips_input_fd[2];
213 if (pipe(pips_output_fd) != 0 || pipe(pips_input_fd) != 0) {
229 if (dup2(pips_output_fd[0], fileno(stdin)) == -1
230 || dup2(pips_input_fd[1], fileno(stdout)) == -1) {
235 execlp(
"daVinci",
"daVinci",
"-pipe", NULL);
236 perror(
"execl of daVinci");
pid_t daVinci_pid
All the stuff to use the graph viewer daVinci from PIPS.
void start_daVinci_if_not_running()
void(* old_SIGCHLD_handler)()
To process some eventual handler somewhere else:
int daVinci_current_context
The daVinci context control:
static void parse_daVinci_answer()
void create_daVinci_new_context()
static void send_command_to_daVinci(string command_format,...)
Send a command to daVinci with an à la printf syntax:
static void monitor_daVinci(int sig, int code, struct sigcontext *scp, char *addr)
static string read_answer_from_daVinci()
void send_graph_to_daVinci(string graph_file_name)
int daVinci_next_context_to_create
FILE * write_to_daVinci_stream
The pipes to communicate with daVinci:
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
#define pips_internal_error
#define user_warning(fn,...)
void safe_system(string)
system.c
struct _newgen_struct_code_ * code
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...