libsysactivity 0.6.2
src/common/memory.h
00001 /*
00002  * libsysactivity
00003  * http://sourceforge.net/projects/libsysactivity/
00004  * Copyright (c) 2009, 2010 Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019  */
00020 
00025 #ifndef SA_MEMORY_H_
00026 #define SA_MEMORY_H_
00027 
00031 SA_EXPORT struct sa_memory {
00032 #ifdef SA_MEMORY_TOTAL
00033         uint64_t total; 
00034 #endif
00035 #ifdef SA_MEMORY_FREE
00036         uint64_t free; 
00037 #endif
00038 #ifdef SA_MEMORY_ACTIVE
00039         uint64_t active; 
00040 #endif
00041 #ifdef SA_MEMORY_INACTIVE
00042         uint64_t inactive; 
00043 #endif
00044 #ifdef SA_MEMORY_BUFFERS
00045         uint64_t buffers; 
00046 #endif
00047 #ifdef SA_MEMORY_SWAP_TOTAL
00048         uint64_t swap_total; 
00049 #endif
00050 #ifdef SA_MEMORY_SWAP_FREE
00051         uint64_t swap_free; 
00052 #endif
00053 #ifdef SA_MEMORY_SWAP_CACHED
00054         uint64_t swap_cached; 
00055 #endif
00056 #ifdef SA_MEMORY_WIRED
00057         uint64_t wired; 
00058 #endif
00059 #ifdef SA_MEMORY_CACHED
00060         uint64_t cached; 
00061 #endif
00062 #ifdef SA_MEMORY_DIRTY
00063         uint64_t dirty; 
00064 #endif
00065 #ifdef SA_MEMORY_EXECUTABLE
00066         uint64_t executable; 
00067 #endif
00068 #ifdef SA_MEMORY_FILES
00069         uint64_t files; 
00070 #endif
00071 #ifdef SA_MEMORY_LOCKED
00072         uint64_t locked; 
00073 #endif
00074 };
00075 
00076 #ifdef SA_OPEN_MEMORY
00077 
00082 int sa_open_memory(void) SA_EXPORT;
00083 #endif
00084 
00085 #ifdef SA_CLOSE_MEMORY
00086 
00091 int sa_close_memory(void) SA_EXPORT;
00092 #endif
00093 
00099 int sa_get_memory(struct sa_memory* dst) SA_EXPORT SA_NONNULL;
00100 
00102 #endif /* SA_MEMORY_H_ */
 All Data Structures Variables