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>
This commit is contained in:
Craig Small
2015-06-20 07:43:02 +10:00
parent 6a0850be7b
commit a410e236ab
18 changed files with 600 additions and 106 deletions

View File

@ -1,12 +1,10 @@
#ifndef PROCPS_PROC_ESCAPE_H
#define PROCPS_PROC_ESCAPE_H
//#include <stdio.h>
#include <sys/types.h>
#include "procps.h"
#include "readproc.h"
#include <proc/procps.h>
#include <proc/readproc.h>
EXTERN_C_BEGIN
__BEGIN_DECLS
#define ESC_STRETCH 1 // since we mangle to '?' this is 1 (would be 4 for octal escapes)
@ -19,5 +17,5 @@ extern int escape_str(char *__restrict dst, const char *__restrict src, int bufs
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);
EXTERN_C_END
__END_DECLS
#endif