svcore  1.9
System.h File Reference
#include "base/Debug.h"
#include <sys/mman.h>
#include <dlfcn.h>
#include <stdio.h>
#include <cmath>
Include dependency graph for System.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MLOCK(a, b)   ::mlock((a),(b))
 
#define MUNLOCK(a, b)   (::munlock((a),(b)) ? (::perror("munlock failed"), 0) : 0)
 
#define MUNLOCK_SAMPLEBLOCK(a)   do { if (!(a).empty()) { const float &b = *(a).begin(); MUNLOCK(&b, (a).capacity() * sizeof(float)); } } while(0);
 
#define DLOPEN(a, b)   dlopen((a).toStdString().c_str(),(b))
 
#define DLSYM(a, b)   dlsym((a),(b))
 
#define DLCLOSE(a)   dlclose((a))
 
#define DLERROR()   dlerror()
 
#define ISNAN   std::isnan
 
#define ISINF   std::isinf
 
#define PLUGIN_GLOB   "*.so"
 
#define PATH_SEPARATOR   ':'
 
#define DEFAULT_LADSPA_PATH   "$HOME/ladspa:$HOME/.ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa"
 
#define DEFAULT_DSSI_PATH   "$HOME/dssi:$HOME/.dssi:/usr/local/lib/dssi:/usr/lib/dssi"
 
#define MUNLOCKALL()   ::munlockall()
 
#define MBARRIER()   SystemMemoryBarrier()
 

Enumerations

enum  ProcessStatus { ProcessRunning, ProcessNotRunning, UnknownProcessStatus }
 

Functions

void SystemMemoryBarrier ()
 
ProcessStatus GetProcessStatus (int pid)
 
void GetRealMemoryMBAvailable (int &available, int &total)
 
int GetDiscSpaceMBAvailable (const char *path)
 
void StoreStartupLocale ()
 
void RestoreStartupLocale ()
 
double mod (double x, double y)
 
float modf (float x, float y)
 
double princarg (double a)
 
float princargf (float a)
 

Macro Definition Documentation

◆ MLOCK

#define MLOCK (   a,
 
)    ::mlock((a),(b))

Definition at line 79 of file System.h.

◆ MUNLOCK

#define MUNLOCK (   a,
 
)    (::munlock((a),(b)) ? (::perror("munlock failed"), 0) : 0)

Definition at line 80 of file System.h.

◆ MUNLOCK_SAMPLEBLOCK

#define MUNLOCK_SAMPLEBLOCK (   a)    do { if (!(a).empty()) { const float &b = *(a).begin(); MUNLOCK(&b, (a).capacity() * sizeof(float)); } } while(0);

Definition at line 81 of file System.h.

◆ DLOPEN

#define DLOPEN (   a,
 
)    dlopen((a).toStdString().c_str(),(b))

Definition at line 86 of file System.h.

◆ DLSYM

#define DLSYM (   a,
 
)    dlsym((a),(b))

Definition at line 87 of file System.h.

◆ DLCLOSE

#define DLCLOSE (   a)    dlclose((a))

Definition at line 88 of file System.h.

◆ DLERROR

#define DLERROR ( )    dlerror()

Definition at line 89 of file System.h.

◆ ISNAN

#define ISNAN   std::isnan

Definition at line 92 of file System.h.

◆ ISINF

#define ISINF   std::isinf

Definition at line 93 of file System.h.

◆ PLUGIN_GLOB

#define PLUGIN_GLOB   "*.so"

Definition at line 123 of file System.h.

◆ PATH_SEPARATOR

#define PATH_SEPARATOR   ':'

Definition at line 124 of file System.h.

◆ DEFAULT_LADSPA_PATH

#define DEFAULT_LADSPA_PATH   "$HOME/ladspa:$HOME/.ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa"

Definition at line 126 of file System.h.

◆ DEFAULT_DSSI_PATH

#define DEFAULT_DSSI_PATH   "$HOME/dssi:$HOME/.dssi:/usr/local/lib/dssi:/usr/lib/dssi"

Definition at line 127 of file System.h.

◆ MUNLOCKALL

#define MUNLOCKALL ( )    ::munlockall()

Definition at line 129 of file System.h.

◆ MBARRIER

#define MBARRIER ( )    SystemMemoryBarrier()

Definition at line 135 of file System.h.

Enumeration Type Documentation

◆ ProcessStatus

Enumerator
ProcessRunning 
ProcessNotRunning 
UnknownProcessStatus 

Definition at line 142 of file System.h.

Function Documentation

◆ SystemMemoryBarrier()

void SystemMemoryBarrier ( )

Definition at line 291 of file System.cpp.

◆ GetProcessStatus()

ProcessStatus GetProcessStatus ( int  pid)

Definition at line 84 of file System.cpp.

References ProcessNotRunning, ProcessRunning, and UnknownProcessStatus.

Referenced by TempDirectory::cleanupAbandonedDirectories().

Here is the caller graph for this function:

◆ GetRealMemoryMBAvailable()

void GetRealMemoryMBAvailable ( int &  available,
int &  total 
)

Definition at line 126 of file System.cpp.

Referenced by StorageAdviser::recommend().

Here is the caller graph for this function:

◆ GetDiscSpaceMBAvailable()

int GetDiscSpaceMBAvailable ( const char *  path)

Definition at line 247 of file System.cpp.

Referenced by StorageAdviser::recommend().

Here is the caller graph for this function:

◆ StoreStartupLocale()

void StoreStartupLocale ( )

Definition at line 304 of file System.cpp.

References startupLocale.

◆ RestoreStartupLocale()

void RestoreStartupLocale ( )

◆ mod()

double mod ( double  x,
double  y 
)

Definition at line 322 of file System.cpp.

Referenced by princarg().

Here is the caller graph for this function:

◆ modf()

float modf ( float  x,
float  y 
)

Definition at line 323 of file System.cpp.

Referenced by princargf().

Here is the caller graph for this function:

◆ princarg()

double princarg ( double  a)

Definition at line 325 of file System.cpp.

References mod().

◆ princargf()

float princargf ( float  a)

Definition at line 326 of file System.cpp.

References modf().

Referenced by FFTModel::estimateStableFrequency(), and FFTModel::getPeakFrequencies().

Here is the caller graph for this function: