mirror of
https://github.com/troglobit/libite.git
synced 2026-10-31 12:50:41 +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
@@ -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