]> granicus.if.org Git - procps-ng/commitdiff
related: adapt to changes in 'context' structure names
authorJim Warner <james.warner@comcast.net>
Thu, 21 Jul 2016 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Tue, 26 Jul 2016 10:47:50 +0000 (20:47 +1000)
Signed-off-by: Jim Warner <james.warner@comcast.net>
13 files changed:
free.c
pgrep.c
pidof.c
pmap.c
proc/test_pids.c
ps/common.h
ps/global.c
ps/output.c
skill.c
slabtop.c
top/top.c
vmstat.c
w.c

diff --git a/free.c b/free.c
index bd32a8532c27a4ba1c693076b9b4e784e91b51e0..20e57c92eab976afbf85f916438771f178d83ff2 100644 (file)
--- 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 7527891b046ccee7a3521fe5a037aa98446f1ffa..389547ac8eea9b8e97518a42a00d5e83cd846134 100644 (file)
--- 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 b73195a0fc08ac17d9c65b561244f6406478c3d2..a79368f0cb6f54cbdf2c17ad2dc027c4131927b0 100644 (file)
--- 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 3e7cf3c32442cc6479ef97378c99d8e2b7f5a38e..2cc6b050d3ed5c7267d934bc2f8ca3f65fba9889 100644 (file)
--- 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;
index 4740067fee81a1ccc8b562251806dc2147615350..4d8b77447a656ccc78873ed8c5822c0a97aee771 100644 (file)
@@ -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) &&
index c7b8f078d460aea97b497d2c9491aee5d5e0c31e..e30c2b995c6a221710d23130f63768030fbdb4d1 100644 (file)
@@ -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)
index d4c8212516b15be7bd64bacda4efd03493645901..1d7e2b73de7001af13c63848f795385ba5381580 100644 (file)
@@ -48,7 +48,7 @@
 
 // --- <pids> interface begin ||||||||||||||||||||||||||||||||||||||||||||
 // -----------------------------------------------------------------------
-struct procps_pidsinfo *Pids_info = NULL;   // our required <pids> context
+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
 
index c3fdfa6a15829241931d39ff405edec0749078e5..8cbc13b70fa87dab7bf9aa4d36739e309fcbf953 100644 (file)
@@ -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 7044cdc642e551b4abd28598e57dc7d99dcc8ba2..8298b91184de4c2220362b74cc084a8b28b17599 100644 (file)
--- 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;
 
index 6399e0b1e223cb5567c7f9640fcc07bbbbe9d677..1f6f5785e7141bd3b7b9dac654a3d17510ba0860 100644 (file)
--- 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;
index 7375955ad6d3ed1f328379f271cc898b50d6ee2c..8ee5959e7feaffe2a8d99f3965fc4b820a50fc18 100644 (file)
--- 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. */
         // --- <proc/meminfo.h> -----------------------------------------------
-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)
         // --- <proc/pids.h> --------------------------------------------------
-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)
         // --- <proc/stat.h> --------------------------------------------------
-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,
index 15340b81fe62fc02340308760358898cf493ac4b..aa02c8ddf54fe7d31d15e63a6885eaf8ec62dff1 100644 (file)
--- 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 610bcc445911ecc97fff3ffe4ac163c0e7418d77..fd2c2e2387403451141a7fde726fd50c3278432f 100644 (file)
--- 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,