procps/proc/escape.h
Craig Small a410e236ab library: sysstat and vmstat api changes
Use the standard libc declarations.
For protecting the headers for C++ procps used to have its
own defines, this change makes them use the standard libc ones.

getstat() -> procps_stat_*
vminfo() -> procps_vmstat_*
These two components of the library now use the newer version of
the API with less exposed global variables. The old methods are
there for now.

Signed-off-by: Craig Small <csmall@enc.com.au>
2015-06-26 22:37:28 +10:00

22 lines
877 B
C

#ifndef PROCPS_PROC_ESCAPE_H
#define PROCPS_PROC_ESCAPE_H
#include <proc/procps.h>
#include <proc/readproc.h>
__BEGIN_DECLS
#define ESC_STRETCH 1 // since we mangle to '?' this is 1 (would be 4 for octal escapes)
#define ESC_ARGS 0x1 // try to use cmdline instead of cmd
#define ESC_BRACKETS 0x2 // if using cmd, put '[' and ']' around it
#define ESC_DEFUNCT 0x4 // mark zombies with " <defunct>"
extern int escape_strlist(char *__restrict dst, char *__restrict const *__restrict src, size_t n, int *cells);
extern int escape_str(char *__restrict dst, const char *__restrict src, int bufsize, int *maxcells);
extern int escape_command(char *__restrict const outbuf, const proc_t *__restrict const pp, int bytes, int *cells, unsigned flags);
extern int escaped_copy(char *__restrict dst, const char *__restrict src, int bufsize, int *maxroom);
__END_DECLS
#endif