tiny.smg.scan.core.count
Defined in scan.core.
API (3)
Actions
Public operations.
Source
Source: tools/smg/src/scan/core/count.zig
zig
const std = @import("std");const smg = @import("../../root.zig");const core = @import("root.zig");const model = smg.model;const Count = core.Count;const SkippedEdgeSample = core.SkippedEdgeSample;const Stats = core.Stats;fn count(items: *std.ArrayList(Count), allocator: std.mem.Allocator, name: []const u8) !void { for (items.items) |*item| { if (std.mem.eql(u8, item.name, name)) { item.count += 1; return; } } try items.append(allocator, .{ .name = try allocator.dupe(u8, name), .count = 1 });}pub fn countLang(stats: *Stats, allocator: std.mem.Allocator, name: []const u8) !void { try count(&stats.lang_counts, allocator, name);}pub fn countType(stats: *Stats, allocator: std.mem.Allocator, name: []const u8) !void { try count(&stats.type_counts, allocator, name);}pub fn recordSkipped(stats: *Stats, allocator: std.mem.Allocator, edge: model.Edge, reason: []const u8, category: []const u8) !void { stats.skipped_edges += 1; try count(&stats.skipped_edge_categories, allocator, category); const sample = SkippedEdgeSample{ .source = edge.source, .rel = edge.rel, .target = edge.target, .reason = reason, .category = category, }; for (stats.skipped_edge_samples.items) |existing| { if (std.mem.eql(u8, existing.source, sample.source) and std.mem.eql(u8, existing.rel, sample.rel) and std.mem.eql(u8, existing.target, sample.target) and std.mem.eql(u8, existing.reason, sample.reason) and std.mem.eql(u8, existing.category, sample.category)) return; } if (stats.skipped_edge_samples.items.len < 10) try stats.skipped_edge_samples.append(allocator, sample);}Source: tools/smg/src/scan/core/root.zig:1
zig
pub const count = @import("count.zig");Complete caller list for scan.core.count.countType
15 direct callers.
tools.smg.src.scan.pipeline.scan.addCDefineConstantNode[function] — private; no exact target attools/smg/src/scan/pipeline/scan.zig:3882in nearest public ownertools.smg.src.scan.pipeline.scantools.smg.src.scan.pipeline.scan.addCLikeFunctionNode[function] — private; no exact target attools/smg/src/scan/pipeline/scan.zig:4190in nearest public ownertools.smg.src.scan.pipeline.scantools.smg.src.scan.pipeline.scan.addCLikeNamespaceNode[function] — private; no exact target attools/smg/src/scan/pipeline/scan.zig:3919in nearest public ownertools.smg.src.scan.pipeline.scantools.smg.src.scan.pipeline.scan.addCLikeRecordNode[function] — private; no exact target attools/smg/src/scan/pipeline/scan.zig:4174in nearest public ownertools.smg.src.scan.pipeline.scantools.smg.src.scan.pipeline.scan.addScanFileModule[function] — private; no exact target attools/smg/src/scan/pipeline/scan.zig:1516in nearest public ownertools.smg.src.scan.pipeline.scantools.smg.src.scan.pipeline.scan.addZigAstContainerContainment[function] — private; no exact target attools/smg/src/scan/pipeline/scan.zig:2589in nearest public ownertools.smg.src.scan.pipeline.scantools.smg.src.scan.pipeline.scan.addZigAstFunctionContainment[function] — private; no exact target attools/smg/src/scan/pipeline/scan.zig:2661in nearest public ownertools.smg.src.scan.pipeline.scantools.smg.src.scan.pipeline.scan.addZigAstMemberGapNode[function] — private; no exact target attools/smg/src/scan/pipeline/scan.zig:2277in nearest public ownertools.smg.src.scan.pipeline.scantools.smg.src.scan.pipeline.scan.addZigAstMemberNode[function] — private; no exact target attools/smg/src/scan/pipeline/scan.zig:2238in nearest public ownertools.smg.src.scan.pipeline.scantools.smg.src.scan.pipeline.scan.addZigAstTestContainment[function] — private; no exact target attools/smg/src/scan/pipeline/scan.zig:2705in nearest public ownertools.smg.src.scan.pipeline.scantools.smg.src.scan.pipeline.scan.addZigLineDeclarationNode[function] — private; no exact target attools/smg/src/scan/pipeline/scan.zig:3357in nearest public ownertools.smg.src.scan.pipeline.scantools.smg.src.scan.pipeline.scan.addZigSimpleNode[function] — private; no exact target attools/smg/src/scan/pipeline/scan.zig:2716in nearest public ownertools.smg.src.scan.pipeline.scantools.smg.src.scan.pipeline.scan.addZigTreeFunctionContainment[function] — private; no exact target attools/smg/src/scan/pipeline/scan.zig:1918in nearest public ownertools.smg.src.scan.pipeline.scantools.smg.src.scan.pipeline.scan.addZigTreeTestContainment[function] — private; no exact target attools/smg/src/scan/pipeline/scan.zig:1961in nearest public ownertools.smg.src.scan.pipeline.scantools.smg.src.scan.pipeline.scan.scanZigTreeContainer[function] — private; no exact target attools/smg/src/scan/pipeline/scan.zig:1803in nearest public ownertools.smg.src.scan.pipeline.scan
Audit
| Definitions | 4 |
|---|---|
| Public names | 7 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |