function tf = isenv(name)
%MATLAB Code Generation Library Function

% Limitations:
% Does not work in parallel regions for mex/sfun targets.

%    Copyright 2023 The MathWorks, Inc.
%#codegen

coder.extrinsic('isenv');
if coder.internal.runs_in_matlab
    tf = isenv(name);
    return
end

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

if coder.internal.isAmbiguousTypes
    tf = false;
    return
end

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

[~, tf] = getenvImpl(name);
