2020-03-06 18:09:57 +08:00
|
|
|
/*
|
2022-05-16 22:06:56 +08:00
|
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
2020-03-06 18:09:57 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2022-05-16 22:06:56 +08:00
|
|
|
inline bool getEnvToBool(const char *name) {
|
2020-03-06 18:09:57 +08:00
|
|
|
const char *env = getenv(name);
|
|
|
|
if ((nullptr == env) || (0 == strcmp("0", env)))
|
|
|
|
return false;
|
|
|
|
return (0 == strcmp("1", env));
|
|
|
|
}
|