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 library itself.

query_exec

Executes the query. Returns the pointer to the query results which is an array of u32. The first element is the length of the array. Subsequent elements are Decl.Index values which are all public declarations.

main.query_exec
export fn query_exec(ignore_case: bool) [*]Decl.Index

File

lib/docs/wasm/main.zig:87

Code

export fn query_exec(ignore_case: bool) [*]Decl.Index {
    const query = query_string.items;
    log.debug("querying '{s}'", .{query});
    query_exec_fallible(query, ignore_case) catch |err| switch (err) {
        error.OutOfMemory => @panic("OOM"),
    };
    query_results.items[0] = @fromBackingInt(@intCast(query_results.items.len - 1));
    return query_results.items.ptr;
}