Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/systat/sysput.c
/*- | /*- | ||||
* Copyright (c) 2019 Yoshihiro Ota | * Copyright (c) 2019, 2020 Yoshihiro Ota | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
* modification, are permitted provided that the following conditions | * modification, are permitted provided that the following conditions | ||||
* are met: | * are met: | ||||
* 1. Redistributions of source code must retain the above copyright | * 1. Redistributions of source code must retain the above copyright | ||||
* notice, this list of conditions and the following disclaimer. | * notice, this list of conditions and the following disclaimer. | ||||
* 2. Redistributions in binary form must reproduce the above copyright | * 2. Redistributions in binary form must reproduce the above copyright | ||||
* notice, this list of conditions and the following disclaimer in the | * notice, this list of conditions and the following disclaimer in the | ||||
Show All 27 Lines | |||||
#include <libutil.h> | #include <libutil.h> | ||||
#include "systat.h" | #include "systat.h" | ||||
#include "extern.h" | #include "extern.h" | ||||
void | void | ||||
sysputspaces(WINDOW *wd, int row, int col, int width) | sysputspaces(WINDOW *wd, int row, int col, int width) | ||||
{ | { | ||||
static char str40[] = " "; | static char str60[] = " " | ||||
" "; | |||||
mvwaddstr(wd, row, col, str40 + sizeof(str40) - width - 1); | mvwaddstr(wd, row, col, str60 + sizeof(str60) - width - 1); | ||||
} | } | ||||
void | void | ||||
sysputstrs(WINDOW *wd, int row, int col, int width) | sysputstrs(WINDOW *wd, int row, int col, int width) | ||||
{ | { | ||||
static char str40[] = "****************************************"; | static char str60[] = "********************" | ||||
"****************************************"; | |||||
mvwaddstr(wnd, row, col, str40 + sizeof(str40) - width - 1); | mvwaddstr(wnd, row, col, str60 + sizeof(str60) - width - 1); | ||||
} | |||||
void | |||||
sysputXs(WINDOW *wd, int row, int col, int width) | |||||
{ | |||||
static char str60[] = "XXXXXXXXXXXXXXXXXXXX" | |||||
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; | |||||
mvwaddstr(wnd, row, col, str60 + sizeof(str60) - width - 1); | |||||
} | } | ||||
void | void | ||||
sysputuint64(WINDOW *wd, int row, int col, int width, uint64_t val, int flags) | sysputuint64(WINDOW *wd, int row, int col, int width, uint64_t val, int flags) | ||||
{ | { | ||||
char unit, *ptr, *start, wrtbuf[width + width + 1]; | char unit, *ptr, *start, wrtbuf[width + width + 1]; | ||||
int len; | int len; | ||||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |