mirror of
https://github.com/troglobit/libite.git
synced 2026-11-29 20:58:25 +00:00
tests: Add example of how to use printhdr()
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
2aed5a6b3f
commit
9d50de3ec7
3 files changed
+22
No files matched your search
@@ -9,6 +9,7 @@ fsendfile
|
|||||||
lfile
|
lfile
|
||||||
makepath
|
makepath
|
||||||
pidfile
|
pidfile
|
||||||
|
printhdr
|
||||||
progress
|
progress
|
||||||
rsync
|
rsync
|
||||||
str
|
str
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ TESTS += fsendfile
|
|||||||
TESTS += lfile
|
TESTS += lfile
|
||||||
TESTS += makepath
|
TESTS += makepath
|
||||||
TESTS += pidfile
|
TESTS += pidfile
|
||||||
|
TESTS += printhdr
|
||||||
TESTS += progress
|
TESTS += progress
|
||||||
TESTS += rsync
|
TESTS += rsync
|
||||||
TESTS += str
|
TESTS += str
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#include <stdlib.h> /* atexit() */
|
||||||
|
#include <unistd.h> /* usleep() */
|
||||||
|
|
||||||
|
#include "check.h"
|
||||||
|
|
||||||
|
#define SCREEN_WIDTH 80
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
FILE *fp = stderr;
|
||||||
|
char buf[SCREEN_WIDTH];
|
||||||
|
|
||||||
|
printhdr(fp, "", 0, UNDERSCORE);
|
||||||
|
printhdr(fp, "Neighbor Table", 0, 0);
|
||||||
|
snprintf(buf, sizeof(buf), "%-15s %-15s %7s %-5s%10s %6s",
|
||||||
|
"Neighbor", "Interface", "Version", "Flags", "Uptime", "Expire");
|
||||||
|
printhdr(fp, buf, 0, REVERSE);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user