Mercurial > hg > svcore
comparison system/System.h @ 1527:710e6250a401 zoom
Merge from default branch
author | Chris Cannam |
---|---|
date | Mon, 17 Sep 2018 13:51:14 +0100 |
parents | bd1a2cacd1e7 |
children | c5ee0746bdef |
comparison
equal
deleted
inserted
replaced
1324:d4a28d1479a8 | 1527:710e6250a401 |
---|---|
2 | 2 |
3 /* | 3 /* |
4 Sonic Visualiser | 4 Sonic Visualiser |
5 An audio file viewer and annotation editor. | 5 An audio file viewer and annotation editor. |
6 Centre for Digital Music, Queen Mary, University of London. | 6 Centre for Digital Music, Queen Mary, University of London. |
7 This file copyright 2006 Chris Cannam and QMUL. | 7 This file copyright 2006-2018 Chris Cannam and QMUL. |
8 | 8 |
9 This program is free software; you can redistribute it and/or | 9 This program is free software; you can redistribute it and/or |
10 modify it under the terms of the GNU General Public License as | 10 modify it under the terms of the GNU General Public License as |
11 published by the Free Software Foundation; either version 2 of the | 11 published by the Free Software Foundation; either version 2 of the |
12 License, or (at your option) any later version. See the file | 12 License, or (at your option) any later version. See the file |
13 COPYING included with this distribution for more information. | 13 COPYING included with this distribution for more information. |
14 */ | 14 */ |
15 | 15 |
16 #ifndef _SYSTEM_H_ | 16 #ifndef SV_SYSTEM_H |
17 #define _SYSTEM_H_ | 17 #define SV_SYSTEM_H |
18 | 18 |
19 #include "base/Debug.h" | 19 #include "base/Debug.h" |
20 | 20 |
21 #ifdef _WIN32 | 21 #ifdef _WIN32 |
22 | 22 |
152 | 152 |
153 enum ProcessStatus { ProcessRunning, ProcessNotRunning, UnknownProcessStatus }; | 153 enum ProcessStatus { ProcessRunning, ProcessNotRunning, UnknownProcessStatus }; |
154 extern ProcessStatus GetProcessStatus(int pid); | 154 extern ProcessStatus GetProcessStatus(int pid); |
155 | 155 |
156 // Return a vague approximation to the number of free megabytes of real memory. | 156 // Return a vague approximation to the number of free megabytes of real memory. |
157 // Return -1 if unknown. (Hence signed args) | 157 // Return -1 if unknown. (Hence signed args.) Note that this could be more than |
158 // is actually addressable, e.g. for a 32-bit process on a 64-bit system. | |
158 extern void GetRealMemoryMBAvailable(ssize_t &available, ssize_t &total); | 159 extern void GetRealMemoryMBAvailable(ssize_t &available, ssize_t &total); |
159 | 160 |
160 // Return a vague approximation to the number of free megabytes of | 161 // Return a vague approximation to the number of free megabytes of |
161 // disc space on the partition containing the given path. Return -1 | 162 // disc space on the partition containing the given path. Return -1 |
162 // if unknown. (Hence signed return type) | 163 // if unknown. (Hence signed return type) |
179 | 180 |
180 #ifdef USE_POW_NO_F | 181 #ifdef USE_POW_NO_F |
181 #define powf pow | 182 #define powf pow |
182 #endif | 183 #endif |
183 | 184 |
185 /** Return the value of the given environment variable by reference. | |
186 Return true if successfully retrieved, false if unset or on error. | |
187 Both the variable name and the returned value are UTF-8 encoded. | |
188 */ | |
189 extern bool getEnvUtf8(std::string variable, std::string &value); | |
190 | |
191 /** Set the value of the given environment variable. | |
192 Return true if successfully set, false on error. | |
193 Both the variable name and the value must be UTF-8 encoded. | |
194 */ | |
195 extern bool putEnvUtf8(std::string variable, std::string value); | |
196 | |
184 #endif /* ! _SYSTEM_H_ */ | 197 #endif /* ! _SYSTEM_H_ */ |
185 | 198 |
186 | 199 |