Commit Graph

24 Commits

Author SHA1 Message Date
Alessandro Toia
10c0f608fd file_utils: add remove_parentheses function and use it for gpu_name 2023-10-03 17:30:20 -07:00
FlightlessMango
f92eb8bce0 file_utils: define procdir 2023-07-25 15:28:09 +02:00
Alessandro Toia
5d1877c2a3 Remove extraneous break 2023-02-01 16:18:50 -08:00
Alessandro Toia
b61f83f522 Add lib_loaded function to check for current loaded libraries 2023-01-04 18:05:56 -08:00
Emil Velikov
2aa49caf52 Remove find_folder() API
Can be trivially replaced with ls()

v2: Move break where it's supposed to.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2022-03-12 18:10:04 +00:00
Emil Velikov
ffb9b592f5 Use a switch in ls() d_type handling
Makes the code much easier to read.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2022-03-12 10:28:18 +00:00
Emil Velikov
ab684a2f24 List regular files with ls(.. LS_FILES)
Currently it can give you a regular file, block/char device, fifo or a
socket.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2022-03-12 10:28:18 +00:00
FlightlessMango
52ae70f650 read_line: return empty line if ifstream fails 2021-12-13 14:33:39 +01:00
jackun
9b6a39dfe9
sed s/gnu_linux/linux/g 2021-10-02 15:25:07 +03:00
jackun
822e325d11
Add get_basename, fix win32 build
std::string::substr likes to throw
2021-08-12 16:07:42 +03:00
jackun
a82e27d978
Use spdlog macros so logging can be completely disabled during compile-time 2021-07-27 16:16:39 +03:00
jackun
2f807a4c0d
Add spdlog wrap and logging 2021-07-16 04:06:09 +03:00
jackun
ea07d1e080
Remove ".exe" from wine executable's name
Fixes ad4e1ac35f
2021-03-22 21:26:11 +02:00
jackun
ad4e1ac35f
Try to get wine executable's name from /proc/self/comm 2021-03-20 14:37:12 +02:00
Witold Baryluk
4f20da781d Improve code for program name extraction
This cleans up the code, as well fixes the bug of not setting
program_name if the MANGOHUD_CONFIG env is specified.

Instead of global variable, that could be not-initialized
use a function to get a program name in logging.

While at it, revamp code and separate things into own functions,
and return by value, and make them easier to use / share code.
2020-12-13 11:35:40 +00:00
jackun
66ddada43c
Fix readlink overloading for fortified musl
Issue #231
2020-06-19 16:15:49 +03:00
jackun
6887abbea8
Just <limits.h> 2020-06-19 16:01:18 +03:00
jackun
a9311bb578
Allow to specify gpu with pci bus id by setting env var MANGOHUD_PCI_DEV=xxxx:xx:xx:x where x's are "domain🚌slot.function" 2020-04-11 00:34:33 +03:00
jackun
e95a96d9f0
If used for other things than just reading sysfs files, xfs/jfs need stat() for inode type 2020-04-05 14:02:15 +03:00
jackun
25b0adfbf9
Move Wine exe name code from config.cpp to get_wine_exe_name(...) 2020-03-25 17:11:29 +02:00
jackun
65b90fc01b
config file: respect XDG dirs
Other half of #37
2020-02-15 13:23:18 +02:00
jackun
90a93fd2fc
Add "get executable's path" function 2020-02-12 22:59:00 +02:00
jackun
b2f20f02d2
Prefix check links too 2020-02-10 12:37:24 +02:00
jackun
b5bfd437a6
Add file and string utility functions 2020-02-04 23:23:01 +02:00