const std = @import("std"); const tmz = @import("tmz"); pub fn main() !void { var buffer: [10_000]u8 = undefined; const file = try std.fs.cwd().readFile("examples/map.tmj", &buffer); var gpa = std.heap.GeneralPurposeAllocator(.{}){}; const allocator = gpa.allocator(); defer _ = gpa.deinit(); var arena = std.heap.ArenaAllocator.init(allocator); defer arena.deinit(); const map = try tmz.parse(file, arena.allocator()); const stdout_file = std.io.getStdOut().writer(); var bw = std.io.bufferedWriter(stdout_file); const stdout = bw.writer(); try stdout.print("Map: {any}\n", .{map}); try bw.flush(); // don't forget to flush! }