function value = getenv(name)
%MATLAB Code Generation Library Function

%    Copyright 2020-2023 The MathWorks, Inc.
%#codegen

narginchk(1, 1);
nameIsString = coder.internal.isTextRow(name);

if coder.internal.isAmbiguousTypes
    value = coder.ignoreConst(blanks(coder.ignoreConst(0)));
    return
end

coder.internal.assert(nameIsString, 'MATLAB:string');
coder.internal.errorIf(strlength(name) > 32766, 'MATLAB:getenv:IllegalNameTooLong');

value = getenvImpl(name);

end