related: change for lost 'PROCPS_' enumerator prefixes

With this patch we've completed a progression toward a
standard approach to naming conventions which follows:

* Only functions will begin with that 'procps_' prefix
. ........................................... examples
. procps_vmstat_get ()
. procps_diskstats_select ()
- ----------------------------------------------------

* Exposed structures begin with the module/header name
. ........................................... examples
. struct pids_info
. struct stat_reaped
- ----------------------------------------------------

* Item enumerators begin like structs, but capitalized
. ........................................... examples
. VMSTAT_COMPACT_FAIL
. MEMINFO_DELTA_ACTIVE

[ slabinfo varies slightly due to some item variants ]
. SLABINFO_extra
. SLABS_SIZE_ACTIVE
. SLABNODE_OBJS_PER_SLAB
[ could cure with a prefix of SLABINFO, but too long ]
- ----------------------------------------------------

* Other enumerators work exactly like item enumerators
. ........................................... examples
. PIDS_SORT_ASCEND
. STAT_REAP_CPUS_AND_NODES
- ----------------------------------------------------

* Macros and constants begin just like the enumerators
. ........................................... examples
. #define SLABINFO_GET
. #define DISKSTATS_TYPE_DISK
- ----------------------------------------------------

Signed-off-by: Jim Warner <james.warner@comcast.net>
This commit is contained in:
Jim Warner
2016-07-21 00:00:00 -05:00
committed by Craig Small
parent c4d097c709
commit 612f36189e
15 changed files with 599 additions and 600 deletions

View File

@ -49,8 +49,8 @@
// --- <pids> interface begin ||||||||||||||||||||||||||||||||||||||||||||
// -----------------------------------------------------------------------
struct pids_info *Pids_info = NULL; // our required <pids> context
enum pids_item *Pids_items; // allocated as PIDSITEMS
int Pids_index; // actual number of active enums
enum pids_item *Pids_items; // allocated as PIDSITEMS
int Pids_index; // actual number of active enums
// most of these could be defined as static in the output.c module
// (but for future flexibility, the easiest route has been chosen)
@ -464,7 +464,7 @@ void reset_global(void){
Pids_items = xcalloc(PIDSITEMS, sizeof(enum pids_item));
for (i = 0; i < PIDSITEMS; i++)
Pids_items[i] = PROCPS_PIDS_noop;
Pids_items[i] = PIDS_noop;
if (!Pids_info) {
if (procps_pids_new(&Pids_info, Pids_items, i)) {
@ -473,7 +473,7 @@ void reset_global(void){
}
}
Pids_items[0] = PROCPS_PIDS_TTY;
Pids_items[0] = PIDS_TTY;
procps_pids_reset(Pids_info, Pids_items, 1);
if (!(p = fatal_proc_unmounted(Pids_info, 1))) {
fprintf(stderr, _("fatal library error, lookup self\n"));
@ -488,7 +488,7 @@ void reset_global(void){
bsd_c_option = 0;
bsd_e_option = 0;
cached_euid = geteuid();
cached_tty = PROCPS_PIDS_VAL(0, s_int, p);
cached_tty = PIDS_VAL(0, s_int, p);
/* forest_prefix must be all zero because of POSIX */
forest_type = 0;
format_flags = 0; /* -l -f l u s -j... */