mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 00:37:23 +01:00
Vulkan: detect vmem (#416)
This commit is contained in:
+10
-1
@@ -88,7 +88,16 @@ bool ffPathExists(const char* path, FFPathType pathType);
|
||||
#endif
|
||||
|
||||
// Not thread safe!
|
||||
void ffSuppressIO(bool suppress);
|
||||
bool ffSuppressIO(bool suppress);
|
||||
|
||||
static inline void ffUnsuppressIO(bool* suppressed)
|
||||
{
|
||||
if (!*suppressed) return;
|
||||
ffSuppressIO(false);
|
||||
*suppressed = false;
|
||||
}
|
||||
|
||||
#define FF_SUPPRESS_IO() bool __attribute__((__cleanup__(ffUnsuppressIO), __unused__)) io_suppressed__ = ffSuppressIO(true)
|
||||
|
||||
void ffListFilesRecursively(const char* path);
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ void ffGetTerminalResponse(const char* request, const char* format, ...)
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void ffSuppressIO(bool suppress)
|
||||
bool ffSuppressIO(bool suppress)
|
||||
{
|
||||
static bool init = false;
|
||||
static int origOut = -1;
|
||||
@@ -173,7 +173,7 @@ void ffSuppressIO(bool suppress)
|
||||
if(!init)
|
||||
{
|
||||
if(!suppress)
|
||||
return;
|
||||
return true;
|
||||
|
||||
origOut = dup(STDOUT_FILENO);
|
||||
origErr = dup(STDERR_FILENO);
|
||||
@@ -182,13 +182,14 @@ void ffSuppressIO(bool suppress)
|
||||
}
|
||||
|
||||
if(nullFile == -1)
|
||||
return;
|
||||
return false;
|
||||
|
||||
fflush(stdout);
|
||||
fflush(stderr);
|
||||
|
||||
dup2(suppress ? nullFile : origOut, STDOUT_FILENO);
|
||||
dup2(suppress ? nullFile : origErr, STDERR_FILENO);
|
||||
return true;
|
||||
}
|
||||
|
||||
void listFilesRecursively(FFstrbuf* folder, uint8_t indentation, const char* folderName)
|
||||
|
||||
@@ -111,9 +111,10 @@ bool ffPathExists(const char* path, FFPathType type)
|
||||
return false;
|
||||
}
|
||||
|
||||
void ffSuppressIO(bool suppress)
|
||||
bool ffSuppressIO(bool suppress)
|
||||
{
|
||||
(void) suppress; //Not implemented.
|
||||
return false;
|
||||
}
|
||||
|
||||
void listFilesRecursively(FFstrbuf* folder, uint8_t indentation, const char* folderName)
|
||||
|
||||
Reference in New Issue
Block a user