25 #include "pips_config.h"
41 #include "constants.h"
61 static char * command = NULL;
62 static int command_size = 0;
64 bool backslash_pending_p = FALSE;
68 if (command_size == 0) {
84 a_character, a_character);
85 if (a_character ==
'\n')
90 if (backslash_pending_p) {
91 backslash_pending_p = FALSE;
92 if (a_character ==
'n')
97 if (position == command_size - 2) {
100 command = realloc(command, command_size);
102 command[position++] = a_character;
106 command[position++] =
'\001';
107 command[position] =
'\0';
121 if (strcmp(command,
"ok\001")) {
127 if (sscanf(command,
"context(\"Context_%d\")\001",
134 if (sscanf(command,
"communication_error(\"%s\")\001",
137 "communication_error(\"%s\")",
buffer);
148 va_list some_arguments;
150 va_start(some_arguments, command_format);
152 va_end(some_arguments);
163 struct sigcontext * scp,
177 ( * old_SIGCHLD_handler)(sig,
code, scp, addr);
181 if (pid != 0 && (statusp & 255) != 127) {
183 pips_debug(5,
"daVinci pid %d exited with status %x\n",
200 int pips_output_fd[2], pips_input_fd[2];
212 if (pipe(pips_output_fd) != 0 || pipe(pips_input_fd) != 0) {
228 if (dup2(pips_output_fd[0], fileno(stdin)) == -1
229 || dup2(pips_input_fd[1], fileno(stdout)) == -1) {
234 execlp(
"daVinci",
"daVinci",
"-pipe", NULL);
235 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:
void create_daVinci_new_context()
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,...)
struct _newgen_struct_code_ * code
int fprintf()
test sc_min : ce test s'appelle par : programme fichier1.data fichier2.data ...
static void parse_daVinci_answer()
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()