MCPcopy
hub / github.com/sql-js/sql.js / _getenv

Function _getenv

js/sql-debug.js:5036–5046  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

5034 }
5035 HEAP32[(((envPtr)+(strings.length * ptrSize))>>2)]=0;
5036 }var ENV={};function _getenv(name) {
5037 // char *getenv(const char *name);
5038 // http://pubs.opengroup.org/onlinepubs/009695399/functions/getenv.html
5039 if (name === 0) return 0;
5040 name = Pointer_stringify(name);
5041 if (!ENV.hasOwnProperty(name)) return 0;
5042
5043 if (_getenv.ret) _free(_getenv.ret);
5044 _getenv.ret = allocate(intArrayFromString(ENV[name]), 'i8', ALLOC_NORMAL);
5045 return _getenv.ret;
5046 }
5047
5048 function _gettimeofday(ptr) {
5049 var now = Date.now();

Callers 1

_unixGetTempnameFunction · 0.70

Calls 4

_freeFunction · 0.85
Pointer_stringifyFunction · 0.70
allocateFunction · 0.70
intArrayFromStringFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…