Zig 0.17.0-dev (Split by item) This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig standard library.
std › os › uefi › tables › runtime_services › RuntimeServices › getVariable Public Function getVariable Doc Source Public Function std.os.uefi.tables.runtime_services.RuntimeServices.getVariable
pub fn getVariable (
self : *const RuntimeServices ,
name : [*:0 ]const u16 ,
guid : *const Guid ,
buffer : []u8 ,
) GetVariableError !?struct Params File os/uefi/tables/runtime_services.zig: 273
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296 pub fn getVariable (
self : *const RuntimeServices ,
name : [*:0 ]const u16 ,
guid : *const Guid ,
buffer : []u8 ,
) GetVariableError !?struct { []u8 , VariableAttributes } {
var attrs : VariableAttributes = undefined ;
var len = buffer .len ;
switch (self ._getVariable (
name ,
guid ,
&attrs ,
&len ,
buffer .ptr ,
)) {
.success => return .{ buffer [0 ..len ], attrs },
.not_found => return null ,
.buffer_too_small => return error .BufferTooSmall ,
.device_error => return error .DeviceError ,
.unsupported => return error .Unsupported ,
else => |status | return uefi .unexpectedStatus (status ),
}
}
To determine the minimum necessary buffer size for the variable, call
getVariableSizefirst.