Skip to documentation
SLOP

tiny.zen.FootnoteSet

Reference tiny.zen FootnoteSet

Defined in tiny.zen.

API (5)

Actions

Public operations.

Fields and members

Public fields and members.

No direct callersNo direct callstiny.zenFootnoteSet
Static calls · unresolved targets: unknown · external targets: unknown.

Source

Source: lib/zen/src/footnote/model.zig:16

zig
pub const Set = struct {    definitions: []Definition,    next_number: usize = 1,    pub fn markFor(self: *Set, key: []const u8) ?Mark {        const index = self.findIndex(key) orelse return null;        const definition = &self.definitions[index];        if (definition.number == 0) {            definition.number = self.next_number;            self.next_number += 1;        }        definition.references += 1;        return .{            .number = definition.number,            .reference = definition.references,        };    }    pub fn hasReferences(self: Set) bool {        for (self.definitions) |definition| {            if (definition.active and definition.references != 0) return true;        }        return false;    }    pub fn findIndex(self: Set, key: []const u8) ?usize {        for (self.definitions, 0..) |definition, index| {            if (definition.active and std.mem.eql(u8, definition.key, key)) return index;        }        return null;    }};

Source: lib/zen/src/root.zig:115

zig
/// Borrowed footnote set that assigns numbers in reference order.pub const FootnoteSet = footnote.Set;
Called byCallsNo direct callsFootnoteSetmarkForFootnoteSetfindIndex
Static calls · unresolved targets: 0 · external targets: 0.
Called byCallsNo direct callersFootnoteSetfindIndexFootnoteSetmarkFor
Static calls · unresolved targets: 0 · external targets: 0.

Also reachable as

footnote.Set.

Audit

Definitions4
Public names8
Members2
Version26.7.0
Revisiondaab053ee433