mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-21 15:34:20 +01:00
Expose sc_get_env() to read environment variable
Contrary to getenv(), sc_get_env() returns an allocated string that is guaranteed to be encoded in UTF-8 on all platforms (it uses _wgetenv() internally on Windows and converts the strings). PR #5560 <https://github.com/Genymobile/scrcpy/pull/5560>
This commit is contained in:
12
app/src/util/env.h
Normal file
12
app/src/util/env.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef SC_ENV_H
|
||||
#define SC_ENV_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
// Return the value of the environment variable (may be NULL).
|
||||
//
|
||||
// The returned value must be freed by the caller.
|
||||
char *
|
||||
sc_get_env(const char *varname);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user