GRASS Programmer's Manual
6.4.3(2013)-r
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Macros
Pages
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
int
G_clicker_prev = 0;
13
14
int
G_clicker
(
void
)
15
{
16
int
x, format;
17
static
char
clicks[] =
"|/-\\"
;
18
19
/* be verbose only 1> */
20
format =
G_info_format
();
21
if
(format == G_INFO_FORMAT_SILENT ||
G_verbose
() < 1)
22
return
0;
23
24
if
(G_clicker_prev == -1 || G_clicker_prev == 3)
25
x = 0;
26
else
27
x = G_clicker_prev + 1;
28
29
fprintf(stderr,
"%1c\b"
, clicks[x]);
30
fflush(stderr);
31
G_clicker_prev = x;
32
33
return
0;
34
}
lib
gis
clicker.c
Generated on Sat Oct 5 2013 12:11:05 for GRASS Programmer's Manual by
1.8.4