Add mj_containsFileVFS and mj_containsBufferVFS functions.

PiperOrigin-RevId: 903785790
Change-Id: I013b37a177284f8440179c4ae5c6221e0f572b49
This commit is contained in:
Sam Haves
2026-04-22 05:26:33 -07:00
committed by Copybara-Service
parent c3fddf5dc1
commit 4cfebcc32b
10 changed files with 156 additions and 0 deletions
+46
View File
@@ -162,6 +162,52 @@ FUNCTIONS: Mapping[str, FunctionDecl] = dict([
),
doc='Delete file from VFS; return 0: success, -1: not found in VFS.',
)),
('mj_containsBufferVFS',
FunctionDecl(
name='mj_containsBufferVFS',
return_type=ValueType(name='int'),
parameters=(
FunctionParameterDecl(
name='vfs',
type=PointerType(
inner_type=ValueType(name='mjVFS'),
),
),
FunctionParameterDecl(
name='name',
type=PointerType(
inner_type=ValueType(name='char', is_const=True),
),
),
),
doc='Check if buffer exists in VFS; return 1: exists, 0: not found.',
)),
('mj_containsFileVFS',
FunctionDecl(
name='mj_containsFileVFS',
return_type=ValueType(name='int'),
parameters=(
FunctionParameterDecl(
name='vfs',
type=PointerType(
inner_type=ValueType(name='mjVFS'),
),
),
FunctionParameterDecl(
name='directory',
type=PointerType(
inner_type=ValueType(name='char', is_const=True),
),
),
FunctionParameterDecl(
name='filename',
type=PointerType(
inner_type=ValueType(name='char', is_const=True),
),
),
),
doc='Check if file exists in VFS; return 1: exists, 0: not found.',
)),
('mj_deleteVFS',
FunctionDecl(
name='mj_deleteVFS',