libsysactivity  0.6.5
 All Data Structures Functions Variables Enumerations Enumerator Groups Pages
memory.h
1 /*
2  * libsysactivity
3  * http://sourceforge.net/projects/libsysactivity/
4  * Copyright (c) 2009, 2010 Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
25 #ifndef SA_MEMORY_H_
26 #define SA_MEMORY_H_
27 
31 struct sa_memory {
32 #ifdef SA_MEMORY_TOTAL
33  uint64_t total;
34 #endif
35 #ifdef SA_MEMORY_FREE
36  uint64_t free;
37 #endif
38 #ifdef SA_MEMORY_ACTIVE
39  uint64_t active;
40 #endif
41 #ifdef SA_MEMORY_INACTIVE
42  uint64_t inactive;
43 #endif
44 #ifdef SA_MEMORY_BUFFERS
45  uint64_t buffers;
46 #endif
47 #ifdef SA_MEMORY_SWAP_TOTAL
48  uint64_t swap_total;
49 #endif
50 #ifdef SA_MEMORY_SWAP_FREE
51  uint64_t swap_free;
52 #endif
53 #ifdef SA_MEMORY_SWAP_CACHED
54  uint64_t swap_cached;
55 #endif
56 #ifdef SA_MEMORY_WIRED
57  uint64_t wired;
58 #endif
59 #ifdef SA_MEMORY_CACHED
60  uint64_t cached;
61 #endif
62 #ifdef SA_MEMORY_DIRTY
63  uint64_t dirty;
64 #endif
65 #ifdef SA_MEMORY_EXECUTABLE
66  uint64_t executable;
67 #endif
68 #ifdef SA_MEMORY_FILES
69  uint64_t files;
70 #endif
71 #ifdef SA_MEMORY_LOCKED
72  uint64_t locked;
73 #endif
74 };
75 
76 #ifdef SA_OPEN_MEMORY
77 
82 int sa_open_memory(void) SA_EXPORT;
83 #endif
84 
85 #ifdef SA_CLOSE_MEMORY
86 
91 int sa_close_memory(void) SA_EXPORT;
92 #endif
93 
99 int sa_get_memory(struct sa_memory* dst) SA_EXPORT SA_NONNULL;
100 
102 #endif /* SA_MEMORY_H_ */