// DIE's signature file

init("compiler", "Zig");

function detect(bShowType, bShowVersion, bShowOptions) {
    if ((ELF.isSectionNamePresent(".rodata")) && (ELF.isDeepScan())) {
        var nIndex = ELF.getSectionNumber(".rodata");

        var nOffset = ELF.getSectionFileOffset(nIndex);
        var nSize = ELF.getSectionFileSize(nIndex);

        var nVersionOffset = ELF.findSignature(nOffset, nSize, "5a49475f44454255475f434f4c4f52"); // ANSI ZIG_DEBUG_COLOR

        if (nVersionOffset != -1) {
            bDetected = 1;
        }
    }

    _setLang("Zig", bDetected);
    return result(bShowType, bShowVersion, bShowOptions);
}