GRASS GIS 7 Programmer's Manual
7.8.4(2020)-exported
clicker.c
Go to the documentation of this file.
1
2
/*-
3
* G_clicker()
4
*
5
* Print a clock hand (one of '|', '/', '-', '\') to stderr.
6
* Used in place of G_percent for unknown number of iterations
7
*
8
*/
9
#include <stdio.h>
10
#include <grass/gis.h>
11
12
static
struct
state
{
13
int
prev;
14
}
state
;
15
16
static
struct
state
*
st
= &
state
;
17
18
void
G_clicker
(
void
)
19
{
20
static
const
char
clicks[] =
"|/-\\"
;
21
int
format =
G_info_format
();
22
23
if
(format == G_INFO_FORMAT_SILENT ||
G_verbose
() < 1)
24
return
;
25
26
st
->prev++;
27
st
->prev %= 4;
28
29
fprintf(stderr,
"%1c\b"
, clicks[
st
->prev]);
30
fflush(stderr);
31
}
G_verbose
int G_verbose(void)
Get current verbosity level.
Definition:
verbose.c:55
state
struct state state
Definition:
parser.c:101
st
struct state * st
Definition:
parser.c:102
G_clicker
void G_clicker(void)
Definition:
clicker.c:18
G_info_format
int G_info_format(void)
Get current message format.
Definition:
gis/error.c:532
gis
clicker.c
Generated on Wed Dec 2 2020 11:18:21 for GRASS GIS 7 Programmer's Manual by
1.8.20