comparison toys/other/vmstat.c @ 674:7e846e281e38

New build infrastructure to generate FLAG_ macros and TT alias, #define FOR_commandname before #including toys.h to trigger it. Rename DEFINE_GLOBALS() to just GLOBALS() (because I could never remember if it was DECLARE_GLOBALS). Convert existing commands to use new infrastructure, and replace optflag constants with FLAG_ macros where appropriate.
author Rob Landley <rob@landley.net>
date Mon, 08 Oct 2012 00:02:30 -0500
parents 6df4ccc0acbe
children 786841fdb1e0
comparison
equal deleted inserted replaced
673:c102f31a753e 674:7e846e281e38
120 unsigned int running = 0, blocked = 0; 120 unsigned int running = 0, blocked = 0;
121 unsigned long mem_swap = 0, mem_free = 0, mem_buff = 0, mem_cache = 0; 121 unsigned long mem_swap = 0, mem_free = 0, mem_buff = 0, mem_cache = 0;
122 unsigned long io_pages_in[2], io_pages_out[2], swap_bytes_in[2], swap_bytes_out[2]; 122 unsigned long io_pages_in[2], io_pages_out[2], swap_bytes_in[2], swap_bytes_out[2];
123 uint64_t sys_irq[2], sys_ctxt[2], cpu_user[2], cpu_sys[2], cpu_idle[2], cpu_wait[2]; 123 uint64_t sys_irq[2], sys_ctxt[2], cpu_user[2], cpu_sys[2], cpu_idle[2], cpu_wait[2];
124 int first_run = 1; 124 int first_run = 1;
125 int no_header = toys.optflags & 0x1; 125 int no_header = toys.optflags;
126 unsigned num_rows = 22; 126 unsigned num_rows = 22;
127 127
128 if (toys.optc >= 1) 128 if (toys.optc >= 1)
129 loop_delay = atoi(toys.optargs[0]); 129 loop_delay = atoi(toys.optargs[0]);
130 if (toys.optc >= 2) 130 if (toys.optc >= 2)