Octopus
varia.h File Reference

Go to the source code of this file.

Functions

void progress_bar (int actual, int max)
 Progress bar dispatcher. More...
 
void sysname (char **c)
 

Function Documentation

◆ progress_bar()

void progress_bar ( int  actual,
int  max 
)

Progress bar dispatcher.

Displays a progress bar only when:

  • Standard output is a terminal (isatty(STDOUT_FILENO) is true at initialisation)
  • The process is in the foreground of that terminal
  • For example, running ./octopus

Progress will not print when redirecting stdout, piping or running in the background:

  • ./octopus > std.out
  • ./octopus >> append.log
  • ./octopus | cat
  • ./octopus &
    Parameters
    actualProgress count. Use -1 on the first call to initialise.
    maxTotal work count (must be > 0).

Definition at line 10714 of file varia.c.

◆ sysname()

void sysname ( char **  c)

Gets the name of the machine

Definition at line 10596 of file varia.c.