PIPS
system.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "genC.h"
#include "misc.h"
+ Include dependency graph for system.c:

Go to the source code of this file.

Functions

void safe_system (string command)
 a safe system call. More...
 
int safe_system_no_abort (string command)
 the command to be executed More...
 
int safe_system_no_abort_no_warning (string command)
 the command to be executed More...
 

Function Documentation

◆ safe_system()

void safe_system ( string  command)

a safe system call.

system.c

abort if fails. FC 09/95 the command to be executed

Parameters
commandommand

Definition at line 38 of file system.c.

39 {
40  int status = system(command);
41 
42  if (status)
43  pips_internal_error("Failed (ret: %d, sig: %d) for %s",
44  (status/0x100) & 0xff, status & 0xff, command);
45 }
#define pips_internal_error
Definition: misc-local.h:149

References pips_internal_error.

Referenced by apply_eole_on_statement(), direct_change_directory(), edit_notify(), gpips_display_graph_file_display(), help_launch_pips_firefox(), hpfc_filter(), hpfc_install(), hpfc_make(), hpfc_print_file(), hpfc_run(), main(), print_c_code(), step_compile_generated_module(), and step_install().

+ Here is the caller graph for this function:

◆ safe_system_no_abort()

int safe_system_no_abort ( string  command)

the command to be executed

For portability reasons, do not use pips_user_warning() here

Parameters
commandommand

Definition at line 47 of file system.c.

48 {
49  int status = system(command);
50 
51  if (status == 127)
52  pips_internal_error("Could not execute : '%s'", command);
53 
54  if (status) {
55  /* For portability reasons, do not use pips_user_warning() here */
56  pips_user_warning("Failed (ret: %d, sig: %d) for '%s'\n",
57  (status/0x100) & 0xff, status & 0xff, command);
58  }
59 
60  return (status / 256) & 255;
61 }
#define pips_user_warning
Definition: misc-local.h:146

References pips_internal_error, and pips_user_warning.

Referenced by check_delete_workspace(), check_input_file_syntax(), process_thru_C_pp(), process_thru_fortran_pp(), and unsplit_internal().

+ Here is the caller graph for this function:

◆ safe_system_no_abort_no_warning()

int safe_system_no_abort_no_warning ( string  command)

the command to be executed

Parameters
commandommand

Definition at line 63 of file system.c.

64 {
65  int status = system(command);
66 
67  if (status == 127)
68  pips_internal_error("Could not execute : '%s'", command);
69 
70  return (status / 256) & 255;
71 }

References pips_internal_error.

Referenced by unsplit_internal().

+ Here is the caller graph for this function: