*
* Contact me: vda.linux@googlemail.com
*/
-
//config:config NMETER
-//config: bool "nmeter"
+//config: bool "nmeter (10 kb)"
//config: default y
//config: help
-//config: Prints selected system stats continuously, one line per update.
+//config: Prints selected system stats continuously, one line per update.
//applet:IF_NMETER(APPLET(nmeter, BB_DIR_USR_BIN, BB_SUID_DROP))
//usage: "\n -d MSEC Milliseconds between updates, default:1000, none:-1"
//usage: "\n"
//usage: "\nFormat specifiers:"
-//usage: "\n %Nc or %[cN] CPU. N - bar size (default:10)"
+//usage: "\n %Nc or %[cN] CPU. N - bar size (default 10)"
//usage: "\n (displays: S:system U:user N:niced D:iowait I:irq i:softirq)"
//usage: "\n %[nINTERFACE] Network INTERFACE"
//usage: "\n %m Allocated memory"
#define proc_meminfo (G.proc_meminfo )
#define proc_diskstats (G.proc_diskstats )
#define proc_sys_fs_filenr (G.proc_sys_fs_filenr)
+#define outbuf bb_common_bufsiz1
#define INIT_G() do { \
+ setup_common_bufsiz(); \
SET_PTR_TO_GLOBALS(xzalloc(sizeof(G))); \
cur_outbuf = outbuf; \
G.final_char = '\n'; \
G.deltanz = G.delta = 1000000; \
} while (0)
-#define outbuf bb_common_bufsiz1
-#define sizeof_outbuf COMMON_BUFSIZE
-
static inline void reset_outbuf(void)
{
cur_outbuf = outbuf;
static void put(const char *s)
{
char *p = cur_outbuf;
- int sz = outbuf + sizeof_outbuf - p;
+ int sz = outbuf + COMMON_BUFSIZE - p;
while (*s && --sz >= 0)
*p++ = *s++;
cur_outbuf = p;
static void put_c(char c)
{
- if (cur_outbuf < outbuf + sizeof_outbuf)
+ if (cur_outbuf < outbuf + COMMON_BUFSIZE)
*cur_outbuf++ = c;
}