summaryrefslogtreecommitdiff
path: root/libps
diff options
context:
space:
mode:
Diffstat (limited to 'libps')
-rw-r--r--libps/ps.h9
1 files changed, 9 insertions, 0 deletions
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,