Moved cursor to external file, added dynamic cursor movement into silent rx_ring...
[netsniff-ng.git] / src / include / netsniff-ng / cursor.h
blob8bf616fc481693c938f5a26956eccd27f302922e
1 /* XXX: Coding Style - use the tool indent with the following (Linux kernel
2 * code indents)
4 * indent -nbad -bap -nbc -bbo -hnl -br -brs -c33 -cd33 -ncdb -ce -ci4 \
5 * -cli0 -d0 -di1 -nfc1 -i8 -ip0 -l120 -lp -npcs -nprs -npsl -sai \
6 * -saf -saw -ncs -nsc -sob -nfca -cp33 -ss -ts8 -il1
9 * netsniff-ng
11 * High performance network sniffer for packet inspection
13 * Copyright (C) 2009, 2010 Daniel Borkmann <danborkmann@googlemail.com> and
14 * Emmanuel Roullit <emmanuel.roullit@googlemail.com>
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 2 of the License, or (at
19 * your option) any later version.
21 * This program is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
23 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24 * for more details.
26 * You should have received a copy of the GNU General Public License along
27 * with this program; if not, write to the Free Software Foundation, Inc.,
28 * 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
30 * Note: Your kernel has to be compiled with CONFIG_PACKET_MMAP=y option in
31 * order to use this.
35 * Contains:
36 * A simple spinning command line cursor
39 #ifndef _CURSOR_H_
40 #define _CURSOR_H_
42 #include <signal.h>
44 extern volatile sig_atomic_t cursor_prog_intr;
46 /* Function signatures */
48 extern void *print_progress_spinner_static(void *msg);
49 extern void *print_progress_spinner_dynamic(void *msg);
50 extern void print_progress_spinner_dynamic_trigger(void);
52 /* Inline stuff */
54 #define enable_print_progress_spinner() \
55 do { \
56 cursor_prog_intr = 0; \
57 } while (0);
59 #define disable_print_progress_spinner() \
60 do { \
61 cursor_prog_intr = 1; \
62 info("\n"); \
63 fflush(stdout); \
64 } while (0);
66 #endif /* _CURSOR_H_ */