From 3f5fdb61239eb6ba68d80ce91535ee08cd5ce37f Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 27 Jun 1996 22:13:54 +0000 Subject: (struct ps_fmt): Add SRC_LEN field. (proc_stat_list_clone, ps_fmt_clone): New declarations. --- libps/ps.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libps') diff --git a/libps/ps.h b/libps/ps.h index 1c475e07..7ae8acb8 100644 --- a/libps/ps.h +++ b/libps/ps.h @@ -743,6 +743,7 @@ struct ps_fmt /* Storage for various strings pointed to by the fields. */ char *src; + size_t src_len; /* Size of SRC. */ /* The string displayed by default for fields that have no valid value. */ char *inval; @@ -792,6 +793,10 @@ void ps_fmt_creation_error (char *src, int posix, /* Free FMT, and any resources it consumes. */ void ps_fmt_free (struct ps_fmt *fmt); +/* Return a copy of FMT in COPY, or an error. This is useful if, for + instance, you would like squash a format without destroying the original. */ +error_t ps_fmt_clone (struct ps_fmt *fmt, struct ps_fmt **copy); + /* Write an appropiate header line for FMT, containing the titles of all its fields appropiately aligned with where the values would be printed, to STREAM (without a trailing newline). If count is non-NULL, the total @@ -852,6 +857,10 @@ error_t proc_stat_list_create (struct ps_context *context, /* Free PP, and any resources it consumes. */ void proc_stat_list_free (struct proc_stat_list *pp); +/* Returns a copy of PP in COPY, or an error. */ +error_t proc_stat_list_clone (struct proc_stat_list *pp, + struct proc_stat_list **copy); + /* Returns the proc_stat in PP with a process-id of PID, if there's one, otherwise, NULL. */ struct proc_stat *proc_stat_list_pid_proc_stat (struct proc_stat_list *pp, -- cgit v1.2.3