-
Notifications
You must be signed in to change notification settings - Fork 3
/
preferences.h
109 lines (83 loc) · 3.19 KB
/
preferences.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
* Copyright (c) 2008 Apple Computer, Inc. All rights reserved.
*
* @APPLE_LICENSE_HEADER_START@
*
* The contents of this file constitute Original Code as defined in and
* are subject to the Apple Public Source License Version 1.1 (the
* "License"). You may not use this file except in compliance with the
* License. Please obtain a copy of the License at
* http://www.apple.com/publicsource and read it before using this file.
*
* This Original Code and all software distributed under the License are
* distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
* License for the specific language governing rights and limitations
* under the License.
*
* @APPLE_LICENSE_HEADER_END@
*/
#ifndef PREFERENCES_H
#define PREFERENCES_H
#include <stdbool.h>
#include <unistd.h>
enum { STATMODE_ACCUM = 1, STATMODE_DELTA, STATMODE_EVENT, STATMODE_NON_EVENT };
void top_prefs_init(void);
/*
* One of:
* a accumulative mode
* d delta mode
* e event mode
* n non-event mode
*/
bool top_prefs_set_mode(const char *mode);
int top_prefs_get_mode(void);
const char *top_prefs_get_mode_string(void);
void top_prefs_set_sleep(int seconds);
int top_prefs_get_sleep(void);
/* Take a symbolic string such as "cpu" */
bool top_prefs_set_sort(const char *sort);
/* Return one of the TOP_SORT enum values from above. */
int top_prefs_get_sort(void);
bool top_prefs_set_secondary_sort(const char *sort);
int top_prefs_get_secondary_sort(void);
const char *top_prefs_get_sort_string(void);
const char *top_prefs_get_secondary_sort_string(void);
/* This is used to sorting in ascending order (if flag is true). */
void top_prefs_set_ascending(bool flag);
bool top_prefs_get_ascending(void);
void top_prefs_set_frameworks(bool flag);
bool top_prefs_get_frameworks(void);
void top_prefs_set_frameworks_interval(int interval);
int top_prefs_get_frameworks_interval(void);
void top_prefs_set_user(const char *user);
char *top_prefs_get_user(void);
void top_prefs_set_user_uid(uid_t uid);
uid_t top_prefs_get_user_uid(void);
/* Returns true if the comma separated names list is invalid. */
bool top_prefs_set_stats(const char *names);
bool top_prefs_get_stats(int *total, int **array);
int top_prefs_get_samples(void);
void top_prefs_set_samples(int s);
int top_prefs_get_nprocs(void);
void top_prefs_set_nprocs(int n);
void top_prefs_add_pid(pid_t pid);
bool top_prefs_want_pid(pid_t pid);
/* Returns true if the signal string is invalid. */
bool top_prefs_set_signal_string(char *s);
int top_prefs_get_signal(const char **sptr);
void top_prefs_set_logging_mode(bool mode);
bool top_prefs_get_logging_mode(void);
void top_prefs_set_ncols(int limit);
/* Returns true if the ncols has been set. */
bool top_prefs_get_ncols(int *limit);
void top_prefs_set_swap(bool show);
bool top_prefs_get_swap(void);
void top_prefs_set_secondary_ascending(bool flag);
bool top_prefs_get_secondary_ascending(void);
/* memory map reporting */
void top_prefs_set_mmr(bool mmr);
bool top_prefs_get_mmr(void);
#endif /*PREFERENCES_H*/