diff --git a/free.c b/free.c index bd32a853..20e57c92 100644 --- a/free.c +++ b/free.c @@ -203,7 +203,7 @@ int main(int argc, char **argv) { int c, flags = 0, unit_set = 0; struct commandline_arguments args; - struct procps_meminfo *mem_info = NULL; + struct meminfo_info *mem_info = NULL; /* * For long options that have no equivalent short option, use a diff --git a/pgrep.c b/pgrep.c index 7527891b..389547ac 100644 --- a/pgrep.c +++ b/pgrep.c @@ -474,7 +474,7 @@ static struct el * select_procs (int *num) #define PIDS_GETINT(e) PROCPS_PIDS_VAL(EU_ ## e, s_int, stack) #define PIDS_GETULL(e) PROCPS_PIDS_VAL(EU_ ## e, ull_int, stack) #define PIDS_GETSTR(e) PROCPS_PIDS_VAL(EU_ ## e, str, stack) - struct procps_pidsinfo *info=NULL; + struct pids_info *info=NULL; struct procps_namespaces nsp; struct pids_stack *stack; unsigned long long saved_start_time; /* for new/old support */ diff --git a/pidof.c b/pidof.c index b73195a0..a79368f0 100644 --- a/pidof.c +++ b/pidof.c @@ -132,7 +132,7 @@ static void select_procs (void) { enum pids_item items[] = { PROCPS_PIDS_ID_PID, PROCPS_PIDS_CMD, PROCPS_PIDS_CMDLINE_V }; enum rel_items { rel_pid, rel_cmd, rel_cmdline }; - struct procps_pidsinfo *info = NULL; + struct pids_info *info = NULL; struct pids_stack *stack; int match; static int size = 0; diff --git a/pmap.c b/pmap.c index 3e7cf3c3..2cc6b050 100644 --- a/pmap.c +++ b/pmap.c @@ -995,7 +995,7 @@ static char *get_default_rc_filename(void) int main(int argc, char **argv) { - struct procps_pidsinfo *info = NULL; + struct pids_info *info = NULL; struct pids_fetch *pids_fetch; unsigned *pidlist; int reap_count, user_count; diff --git a/proc/test_pids.c b/proc/test_pids.c index 4740067f..4d8b7744 100644 --- a/proc/test_pids.c +++ b/proc/test_pids.c @@ -33,14 +33,14 @@ int check_pids_new_nullinfo(void *data) int check_pids_new_toomany(void *data) { - struct procps_pidsinfo *info; + struct pids_info *info; testname = "procps_pids_new() too many items returns -EINVAL"; return (procps_pids_new(&info, items, 1) == -EINVAL); } int check_pids_new_and_unref(void *data) { - struct procps_pidsinfo *info = NULL; + struct pids_info *info = NULL; testname = "procps_pids new then unref"; return ( (procps_pids_new(&info, items, 2) == 0) && (procps_pids_unref(&info) == 0) && diff --git a/ps/common.h b/ps/common.h index c7b8f078..e30c2b99 100644 --- a/ps/common.h +++ b/ps/common.h @@ -59,9 +59,9 @@ return 0; \ } } -extern struct procps_pidsinfo *Pids_info; -extern enum pids_item *Pids_items; -extern int Pids_index; +extern struct pids_info *Pids_info; +extern enum pids_item *Pids_items; +extern int Pids_index; // most of these need not be extern, they're unique to output.c // (but for future flexibility the easiest path has been taken) diff --git a/ps/global.c b/ps/global.c index d4c82125..1d7e2b73 100644 --- a/ps/global.c +++ b/ps/global.c @@ -48,7 +48,7 @@ // --- interface begin |||||||||||||||||||||||||||||||||||||||||||| // ----------------------------------------------------------------------- -struct procps_pidsinfo *Pids_info = NULL; // our required context +struct pids_info *Pids_info = NULL; // our required context enum pids_item *Pids_items; // allocated as PIDSITEMS int Pids_index; // actual number of active enums diff --git a/ps/output.c b/ps/output.c index c3fdfa6a..8cbc13b7 100644 --- a/ps/output.c +++ b/ps/output.c @@ -91,7 +91,7 @@ extern long Hertz; static void get_boot_time(void) { - struct procps_statinfo *stat_info = NULL; + struct stat_info *stat_info = NULL; if (procps_stat_new(&stat_info) < 0) xerrx(EXIT_FAILURE, _("Unable to create NEW ystem stat structure")); boot_time = PROCPS_STAT_GET(stat_info, PROCPS_STAT_SYS_TIME_OF_BOOT, ul_int); @@ -100,7 +100,7 @@ static void get_boot_time(void) static void get_memory_total() { - struct procps_meminfo *mem_info = NULL; + struct meminfo_info *mem_info = NULL; if (procps_meminfo_new(&mem_info) < 0) xerrx(EXIT_FAILURE, _("Unable to create meminfo structure")); diff --git a/skill.c b/skill.c index 7044cdc6..8298b911 100644 --- a/skill.c +++ b/skill.c @@ -264,7 +264,7 @@ static void scan_procs(struct run_time_conf_t *run_time) { #define PIDS_GETINT(e) PROCPS_PIDS_VAL(EU_ ## e, s_int, reap->stacks[i]) #define PIDS_GETSTR(e) PROCPS_PIDS_VAL(EU_ ## e, str, reap->stacks[i]) - struct procps_pidsinfo *info=NULL; + struct pids_info *info=NULL; struct pids_fetch *reap; int i, total_procs; diff --git a/slabtop.c b/slabtop.c index 6399e0b1..1f6f5785 100644 --- a/slabtop.c +++ b/slabtop.c @@ -53,7 +53,7 @@ static struct termios Saved_tty; static long Delay = 3; static int Run_once = 0; -static struct procps_slabinfo *Slab_info; +static struct slabinfo_info *Slab_info; enum slabinfo_item Sort_item = DEFAULT_SORT; enum slabinfo_sort_order Sort_Order = PROCPS_SLABINFO_DESCEND; diff --git a/top/top.c b/top/top.c index 7375955a..8ee5959e 100644 --- a/top/top.c +++ b/top/top.c @@ -198,7 +198,7 @@ static const char Graph_bars[] = "|||||||||||||||||||||||||||||||||||||||||||||| /* Support for the new library API -- acquired (if necessary) at program startup and referenced throughout our lifetime. */ // --- ----------------------------------------------- -static struct procps_meminfo *Mem_ctx; +static struct meminfo_info *Mem_ctx; static struct meminfo_stack *Mem_stack; static enum meminfo_item Mem_items[] = { PROCPS_MEMINFO_MEM_FREE, PROCPS_MEMINFO_MEM_USED, PROCPS_MEMINFO_MEM_TOTAL, @@ -210,7 +210,7 @@ enum Rel_memitems { // mem stack results extractor macro, where e=rel enum #define MEM_VAL(e) PROCPS_MEMINFO_VAL(e, ul_int, Mem_stack) // --- -------------------------------------------------- -static struct procps_pidsinfo *Pids_ctx; +static struct pids_info *Pids_ctx; static int Pids_itms_cur; // 'current' max (<= Fieldstab) static enum pids_item *Pids_itms; // allocated as MAXTBL(Fieldstab) static struct pids_fetch *Pids_reap; // for reap or select @@ -220,7 +220,7 @@ static struct pids_fetch *Pids_reap; // for reap or select // ( but many functions use their own unique tailored version for access ) #define PID_VAL(e,t,s) PROCPS_PIDS_VAL(Fieldstab[ e ].erel, t, s) // --- -------------------------------------------------- -static struct procps_statinfo *Stat_ctx; +static struct stat_info *Stat_ctx; static struct stat_reaped *Stat_reap; static enum stat_item Stat_items[] = { PROCPS_STAT_TIC_ID, PROCPS_STAT_TIC_NUMA_NODE, diff --git a/vmstat.c b/vmstat.c index 15340b81..aa02c8dd 100644 --- a/vmstat.c +++ b/vmstat.c @@ -345,16 +345,17 @@ static void new_format(void) struct tm *tm_ptr; time_t the_time; char timebuf[32]; - struct procps_vmstat *vm_info = NULL; - struct procps_statinfo *sys_info = NULL; + struct vmstat_info *vm_info = NULL; + struct stat_info *sys_info = NULL; struct stat_stack *stat_stack; - struct procps_meminfo *mem_info = NULL; + struct meminfo_info *mem_info = NULL; struct meminfo_stack *mem_stack; sleep_half = (sleep_time / 2); hz = procps_hertz_get(); new_header(); + if (procps_vmstat_new(&vm_info) < 0) xerrx(EXIT_FAILURE, _("Unable to create vmstat structure")); if (procps_stat_new(&sys_info) < 0) @@ -529,7 +530,7 @@ static void diskpartition_header(const char *partition_name) static void diskpartition_format(const char *partition_name) { #define partVAL(x) PROCPS_DISKSTATS_VAL(x, ul_int, stack) - struct procps_diskstats *disk_stat; + struct diskstats_info *disk_stat; struct diskstats_stack *stack; struct diskstats_result *got; const char format[] = "%20lu %10lu %10lu %10lu\n"; @@ -627,7 +628,7 @@ static void diskheader(void) static void diskformat(void) { #define diskVAL(e,t) PROCPS_DISKSTATS_VAL(e, t, reap->stacks[j]) - struct procps_diskstats *disk_stat; + struct diskstats_info *disk_stat; struct diskstats_reap *reap; int i, j; time_t the_time; @@ -703,7 +704,7 @@ static void slabheader(void) static void slabformat (void) { #define MAX_ITEMS (int)(sizeof(node_items) / sizeof(node_items[0])) - struct procps_slabinfo *slab_info; + struct slabinfo_info *slab_info; struct slabinfo_reap *reaped; int i, j; enum slabinfo_item node_items[] = { @@ -746,7 +747,7 @@ static void slabformat (void) static void disksum_format(void) { #define diskVAL(e,t) PROCPS_DISKSTATS_VAL(e, t, reap->stacks[j]) - struct procps_diskstats *disk_stat; + struct diskstats_info *disk_stat; struct diskstats_reap *reap; int j, disk_count, part_count; unsigned long reads, merged_reads, read_sectors, milli_reading, writes, @@ -807,9 +808,9 @@ static void sum_format(void) #define TICv(E) PROCPS_STAT_VAL(E, ull_int, stat_stack) #define SYSv(E) PROCPS_STAT_VAL(E, ul_int, stat_stack) #define MEMv(E) unitConvert(PROCPS_STAT_VAL(E, ul_int, mem_stack)) - struct procps_statinfo *sys_info = NULL; - struct procps_vmstat *vm_info = NULL; - struct procps_meminfo *mem_info = NULL; + struct stat_info *sys_info = NULL; + struct vmstat_info *vm_info = NULL; + struct meminfo_info *mem_info = NULL; struct stat_stack *stat_stack; struct meminfo_stack *mem_stack; @@ -864,7 +865,7 @@ static void sum_format(void) static void fork_format(void) { - struct procps_statinfo *sys_info = NULL; + struct stat_info *sys_info = NULL; if (procps_stat_new(&sys_info) < 0) xerrx(EXIT_FAILURE, _("Unable to create system stat structure")); diff --git a/w.c b/w.c index 610bcc44..fd2c2e23 100644 --- a/w.c +++ b/w.c @@ -352,7 +352,7 @@ static int find_best_proc( unsigned long long best_time = 0; unsigned long long secondbest_time = 0; - struct procps_pidsinfo *info=NULL; + struct pids_info *info=NULL; struct pids_fetch *reap; enum pids_item items[] = { PROCPS_PIDS_ID_TGID,