00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SA_MEMORY
00022 #warning You should not include this file directly from your program.
00023 #endif
00024
00029 #ifndef SA_COMMON_MEMORY_H_
00030 #define SA_COMMON_MEMORY_H_
00031
00035 SA_EXPORT struct sa_memory {
00036 #ifdef SA_MEMORY_TOTAL
00037 uint64_t total;
00038 #endif
00039 #ifdef SA_MEMORY_FREE
00040 uint64_t free;
00041 #endif
00042 #ifdef SA_MEMORY_ACTIVE
00043 uint64_t active;
00044 #endif
00045 #ifdef SA_MEMORY_INACTIVE
00046 uint64_t inactive;
00047 #endif
00048 #ifdef SA_MEMORY_BUFFERS
00049 uint64_t buffers;
00050 #endif
00051 #ifdef SA_MEMORY_SWAP_TOTAL
00052 uint64_t swap_total;
00053 #endif
00054 #ifdef SA_MEMORY_SWAP_FREE
00055 uint64_t swap_free;
00056 #endif
00057 #ifdef SA_MEMORY_SWAP_CACHED
00058 uint64_t swap_cached;
00059 #endif
00060 #ifdef SA_MEMORY_WIRED
00061 uint64_t wired;
00062 #endif
00063 #ifdef SA_MEMORY_CACHED
00064 uint64_t cached;
00065 #endif
00066 #ifdef SA_MEMORY_DIRTY
00067 uint64_t dirty;
00068 #endif
00069 #ifdef SA_MEMORY_EXECUTABLE
00070 uint64_t executable;
00071 #endif
00072 #ifdef SA_MEMORY_FILES
00073 uint64_t files;
00074 #endif
00075 #ifdef SA_MEMORY_LOCKED
00076 uint64_t locked;
00077 #endif
00078 };
00079
00083 SA_EXPORT struct sa_swap {
00084 #ifdef SA_SWAP_NAME
00085 char name[SA_SWAP_NAME];
00086 #endif
00087 #ifdef SA_SWAP_TOTAL
00088 uint64_t total;
00089 #endif
00090 #ifdef SA_SWAP_FREE
00091 uint64_t free;
00092 #endif
00093 #ifdef SA_SWAP_TYPE
00094 int8_t type;
00095 #endif
00096 };
00097
00098 #ifdef SA_OPEN_MEMORY
00099
00104 SA_EXPORT int sa_open_memory(void);
00105 #endif
00106
00107 #ifdef SA_CLOSE_MEMORY
00108
00113 SA_EXPORT int sa_close_memory(void);
00114 #endif
00115
00121 SA_EXPORT int sa_get_memory(struct sa_memory* dst);
00122
00128 SA_EXPORT int sa_count_swaps(uint16_t* number);
00129
00136 SA_EXPORT int sa_get_swap(uint16_t index, struct sa_swap* dst);
00137
00145 SA_EXPORT int sa_get_swaps(struct sa_swap* dst, uint16_t dst_size, uint16_t* written);
00146
00148 #endif