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

Go to the source code of this file.

Functions

void start_dotting (FILE *dotting_file, const char dotting_character, const char *fmt,...)
 Sorry to keep you waiting... More...
 
void stop_dotting ()
 

Function Documentation

◆ start_dotting()

void start_dotting ( FILE *  dotting_file,
const char  dotting_character,
const char *  fmt,
  ... 
)

Sorry to keep you waiting...

dotting.c

Emit a message and then a waiting character every second till it is notified to shut up.

Francois Irigoin, 18 April 1990

Modification:

  • installed in Lib/misc/dotting.c, 21 April 1990
  • no more dotting: in wpips, the window io associated to each dotting requires a malloc(); as it may occur at any time, malloc() (or free()) may be already active and wpips core dumps; (Francois Irigoin, Bruno Baron, ?? ???? 1990) start_dotting: the profile should be changed and varargs used so as to let user emit the initial message as with a fprintf the dotting character could be a constant (e.g. '.') or be passed as first argument start_dotting(dotting_file, dotting_character, format, args) ARARGS3
Parameters
dotting_fileotting_file
dotting_characterotting_character
fmtmt

Definition at line 78 of file dotting.c.

82 {
83  pips_debug(9, "dotting with '%c'", dotting_character);
84 
85  va_list args;
86 
87  va_start(args, fmt);
88 
89  if (dotting_file == stdout)
90  (* pips_log_handler)(fmt, &args);
91  else {
92  vfprintf(dotting_file, fmt, args);
93  if(dotting_file!=stderr) fflush(dotting_file);
94  }
95  va_end(args);
96 /*
97  if((int) signal(SIGALRM, print_dot)==-1) {
98  pips_internal_error("signal error");
99  exit(1);
100  }
101  alarm(1);
102  */
103 }
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145

References pips_debug.

◆ stop_dotting()

void stop_dotting ( void  )

alarm(0); (void) signal(SIGALRM, SIG_DFL);

Vire le "\n" qui interfère... RK. if (dotting_file == stdout) user_log("\n"); else { (void) putc('
', dotting_file); if(dotting_file!=stderr) fflush(dotting_file); }

Definition at line 105 of file dotting.c.

106 {
107 /* alarm(0);
108  (void) signal(SIGALRM, SIG_DFL);
109 
110  Vire le "\n" qui interfère... RK.
111  if (dotting_file == stdout)
112  user_log("\n");
113  else {
114  (void) putc('\n', dotting_file);
115  if(dotting_file!=stderr) fflush(dotting_file);
116  }
117 */
118 }