summaryrefslogtreecommitdiffstats
path: root/ProcessList.h
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2006-03-24 03:39:04 +0000
committerHisham Muhammad <hisham@gobolinux.org>2006-03-24 03:39:04 +0000
commit86d63135607fbad7f9821124c8b6ca34d02a001c (patch)
tree068346bc5f56c85b8ebfb696a39b17ad1f05c896 /ProcessList.h
parenta3a8a3b24b9479457ecf25d82a050c2fe9ce72d2 (diff)
* make debug target
* Support for generating a /proc trace for debugging purposes.
Diffstat (limited to 'ProcessList.h')
-rw-r--r--ProcessList.h48
1 files changed, 40 insertions, 8 deletions
diff --git a/ProcessList.h b/ProcessList.h
index 969d4450..23d28f22 100644
--- a/ProcessList.h
+++ b/ProcessList.h
@@ -1,14 +1,19 @@
-/* Do not edit this file. It was automatically genarated. */
+/* Do not edit this file. It was automatically generated. */
#ifndef HEADER_ProcessList
#define HEADER_ProcessList
/*
-htop - ProcessList.h
-(C) 2004-2006 Hisham H. Muhammad
+htop - ProcessList.c
+(C) 2004,2005 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
+#ifndef CONFIG_H
+#define CONFIG_H
+#include "config.h"
+#endif
+
#include "Process.h"
#include "TypedVector.h"
#include "UsersTable.h"
@@ -23,6 +28,7 @@ in the source distribution for its full text.
#include <signal.h>
#include <stdbool.h>
#include <sys/utsname.h>
+#include <stdarg.h>
#include "debug.h"
#include <assert.h>
@@ -43,6 +49,12 @@ in the source distribution for its full text.
#define MAX_NAME 128
#endif
+#ifndef MAX_READ
+#define MAX_READ 8192
+#endif
+
+
+
typedef struct ProcessList_ {
TypedVector* processes;
TypedVector* processes2;
@@ -75,11 +87,6 @@ typedef struct ProcessList_ {
long int usedSwap;
long int freeSwap;
- int kernelMajor;
- int kernelMiddle;
- int kernelMinor;
- int kernelTiny;
-
ProcessField* fields;
ProcessField sortKey;
int direction;
@@ -90,10 +97,30 @@ typedef struct ProcessList_ {
bool treeView;
bool highlightBaseName;
bool highlightMegabytes;
+ #ifdef DEBUG
+ FILE* traceFile;
+ #endif
} ProcessList;
+#ifdef DEBUG
+
+
+#define ProcessList_read(this, buffer, format, ...) ProcessList_xread(this, (vxscanf) vsscanf, buffer, format, ## __VA_ARGS__ )
+#define ProcessList_fread(this, file, format, ...) ProcessList_xread(this, (vxscanf) vfscanf, file, format, ## __VA_ARGS__ )
+
+
+
+#else
+
+#ifndef ProcessList_read
+#define ProcessList_fopen(this, path, mode) fopen(path, mode)
+#define ProcessList_read(this, buffer, format, ...) sscanf(buffer, format, ## __VA_ARGS__ )
+#define ProcessList_fread(this, file, format, ...) fscanf(file, format, ## __VA_ARGS__ )
+#endif
+
+#endif
ProcessList* ProcessList_new(UsersTable* usersTable);
@@ -103,6 +130,7 @@ void ProcessList_invertSortOrder(ProcessList* this);
RichString ProcessList_printHeader(ProcessList* this);
+
void ProcessList_prune(ProcessList* this);
void ProcessList_add(ProcessList* this, Process* p);
@@ -117,6 +145,10 @@ int ProcessList_size(ProcessList* this);
void ProcessList_sort(ProcessList* this);
+bool ProcessList_readStatusFile(ProcessList* this, Process* proc, char* dirname, char* name);
+
+void ProcessList_processEntries(ProcessList* this, char* dirname, int parent, float period);
+
void ProcessList_scan(ProcessList* this);
void ProcessList_dontCrash(int signal);

© 2014-2024 Faster IT GmbH | imprint | privacy policy