diff --git a/build.zig b/build.zig new file mode 100644 index 0000000..b04dca6 --- /dev/null +++ b/build.zig @@ -0,0 +1,97 @@ +const std = @import("std"); + +// Although this function looks imperative, note that its job is to +// declaratively construct a build graph that will be executed by an external +// runner. +pub fn build(b: *std.Build) void { + // Standard target options allows the person running `zig build` to choose + // what target to build for. Here we do not override the defaults, which + // means any target is allowed, and the default is native. Other options + // for restricting supported target set are available. + const target = b.standardTargetOptions(.{}); + + // Standard optimization options allow the person running `zig build` to select + // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not + // set a preferred release mode, allowing the user to decide how to optimize. + const optimize = b.standardOptimizeOption(.{}); + + const lib = b.addStaticLibrary(.{ + .name = "proxy-print", + // In this case the main source file is merely a path, however, in more + // complicated build scripts, this could be a generated file. + .root_source_file = b.path("src/root.zig"), + .target = target, + .optimize = optimize, + }); + + // This declares intent for the library to be installed into the standard + // location when the user invokes the "install" step (the default step when + // running `zig build`). + b.installArtifact(lib); + + const exe = b.addExecutable(.{ + .name = "proxy-print", + .root_source_file = b.path("src/main.zig"), + .target = target, + .optimize = optimize, + }); + + // This declares intent for the executable to be installed into the + // standard location when the user invokes the "install" step (the default + // step when running `zig build`). + b.installArtifact(exe); + + // This *creates* a Run step in the build graph, to be executed when another + // step is evaluated that depends on it. The next line below will establish + // such a dependency. + const run_cmd = b.addRunArtifact(exe); + const msgpack = b.dependency("zig-msgpack", .{ + .target = target, + .optimize = optimize, +}); + + exe.root_module.addImport("msgpack", msgpack.module("msgpack")); + + // By making the run step depend on the install step, it will be run from the + // installation directory rather than directly from within the cache directory. + // This is not necessary, however, if the application depends on other installed + // files, this ensures they will be present and in the expected location. + run_cmd.step.dependOn(b.getInstallStep()); + + // This allows the user to pass arguments to the application in the build + // command itself, like this: `zig build run -- arg1 arg2 etc` + if (b.args) |args| { + run_cmd.addArgs(args); + } + + // This creates a build step. It will be visible in the `zig build --help` menu, + // and can be selected like this: `zig build run` + // This will evaluate the `run` step rather than the default, which is "install". + const run_step = b.step("run", "Run the app"); + run_step.dependOn(&run_cmd.step); + + // Creates a step for unit testing. This only builds the test executable + // but does not run it. + const lib_unit_tests = b.addTest(.{ + .root_source_file = b.path("src/root.zig"), + .target = target, + .optimize = optimize, + }); + + const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests); + + const exe_unit_tests = b.addTest(.{ + .root_source_file = b.path("src/main.zig"), + .target = target, + .optimize = optimize, + }); + + const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests); + + // Similar to creating the run step earlier, this exposes a `test` step to + // the `zig build --help` menu, providing a way for the user to request + // running the unit tests. + const test_step = b.step("test", "Run unit tests"); + test_step.dependOn(&run_lib_unit_tests.step); + test_step.dependOn(&run_exe_unit_tests.step); +} diff --git a/build.zig.zon b/build.zig.zon new file mode 100644 index 0000000..f2bc838 --- /dev/null +++ b/build.zig.zon @@ -0,0 +1,40 @@ +.{ + .name = "proxy-print", + // This is a [Semantic Version](https://semver.org/). + // In a future version of Zig it will be used for package deduplication. + .version = "0.0.0", + + // This field is optional. + // This is currently advisory only; Zig does not yet do anything + // with this value. + //.minimum_zig_version = "0.11.0", + + // This field is optional. + // Each dependency must either provide a `url` and `hash`, or a `path`. + // `zig build --fetch` can be used to fetch all dependencies of a package, recursively. + // Once all dependencies are fetched, `zig build` no longer requires + // internet connectivity. + .dependencies = .{ + .@"zig-msgpack" = .{ + .url = "https://github.com/zigcc/zig-msgpack/archive/main.tar.gz", + .hash = "1220e4669d29190ac809cd3a7726c20b6b49ea7425b7b89cab16d4dc3172016982bc", + }, + .clap = .{ + .url = "https://github.com/Hejsil/zig-clap/archive/refs/tags/0.8.0.tar.gz", + .hash = "1220949d4e88864579067b6d4cdad6476c6176f27e782782c2c39b7f2c4817a10efb", + }, + }, + .paths = .{ + // This makes *all* files, recursively, included in this package. It is generally + // better to explicitly list the files and directories instead, to insure that + // fetching from tarballs, file system paths, and version control all result + // in the same contents hash. + "", + // For example... + //"build.zig", + //"build.zig.zon", + //"src", + //"LICENSE", + //"README.md", + }, +} diff --git a/fullCard.zig b/fullCard.zig new file mode 100644 index 0000000..d9567dd --- /dev/null +++ b/fullCard.zig @@ -0,0 +1,120 @@ +{ + // object: ?[]const u8,//string + // id: ?[]const u8,//string + // oracle_id: ?[]const u8,//string + // multiverse_ids: ?[]u32,//array of int + // mtgo_id: ?u32,//int + // mtgo_foil_id: ?u32,//int + // tcgplayer_id: ?u32,//int + // cardmarket_id: ?u32,//int + name: ?[]const u8,//string + // lang: ?[]const u8,//string + // released_at: ?[]const u8,//string + // uri: ?[]const u8,//string + // scryfall_uri: ?[]const u8,//string + // layout: ?[]const u8,//string + // highres_image: ?bool,//bool + // image_status: ?[]const u8,//string + // image_uris: ?ImgList,//obj (strings) + mana_cost: ?[]const u8 = "",//string + cmc: ?f32,//technically a float? but I think we can always cast safely EDIT: NOPE + type_line: ?[]const u8,//string + oracle_text: ?[]const u8 = "",//string + // colors: json.Value,//?[]const u8,//array of Chars + color_identity: json.Value,//?[]const u8,//array of Chars + keywords: ?[][]const u8,//array of Strings + // legalities: ?Legalities,//obj (strings) + // games: ?[][]const u8,//array of Strings + // reserved: ?bool,//bool + // foil: ?bool,//bool + // nonfoil: ?bool,//bool + // finishes: ?[][]const u8,//array of Strings + // oversized: ?bool,//bool + // promo: ?bool,//bool + // reprint: ?bool,//bool + // variation: ?bool,//bool + // set_id: ?[]const u8,//string + // set: ?[]const u8,//string + // set_name: ?[]const u8,//string + // set_type: ?[]const u8,//string + // set_uri: ?[]const u8,//string + // set_search_uri: ?[]const u8,//string + // scryfall_set_uri: ?[]const u8,//string + // rulings_uri: ?[]const u8,//string + // prints_search_uri: ?[]const u8,//string + // collector_number: ?[]const u8,//string + // digital: ?bool,//bool + // rarity: ?[]const u8,//string + // flavor_text: ?[]const u8,//string + // card_back_id: ?[]const u8,//string + // artist: ?[]const u8,//string + // artist_ids: ?[][]const u8,//string + // illustration_id: ?[]const u8,//string + // border_color: ?[]const u8,//string + // frame: ?[]const u8,//string + // full_art: ?bool,//bool + // textless: ?bool,//bool + // booster: ?bool,//bool + // story_spotlight: ?bool,//bool + // edhrec_rank: ?u32,//int + // prices: ?Prices,//obj (floats stored as strings) + // related_uris: json.Value,//?RelatedUris,//obj (strings) + // purchase_uris: json.Value,//?PurchaseUris,//obj (strings) +} + +const PurchaseUris = struct { + tcgplayer: ?[]const u8,//string + cardmarket: ?[]const u8,//string + cardhoarder: ?[]const u8,//string +}; + +const Prices = struct { + usd: ?[]const u8,//string? but technically a float + usd_foil: ?[]const u8,//same + usd_etched: ?[]const u8,//same + eur: ?[]const u8,//same + eur_foil: ?[]const u8,//same + tix: ?[]const u8,//same +}; + +const RelatedUris = struct { + gatherer: ?[]const u8,//string + tcgplayer_infinite_articles: ?[]const u8,//string + tcgplayer_infinite_decks: ?[]const u8,//string + edhrec: ?[]const u8,//string +}; + +const Legalities = struct { + standard: ?[]const u8,//string + future: ?[]const u8,//string + historic: ?[]const u8,//string + timeless: ?[]const u8,//string + gladiator: ?[]const u8,//string + pioneer: ?[]const u8,//string + explorer: ?[]const u8,//string + modern: ?[]const u8,//string + legacy: ?[]const u8,//string + pauper: ?[]const u8,//string + vintage: ?[]const u8,//string + penny: ?[]const u8,//string + commander: ?[]const u8,//string + oathbreaker:?[]const u8,//string + standardbrawl:?[]const u8,//string + brawl: ?[]const u8,//string + alchemy: ?[]const u8,//string + paupercommander:?[]const u8,//string + duel: ?[]const u8,//string + oldschool: ?[]const u8,//string + premodern: ?[]const u8,//string + predh: ?[]const u8,//string +}; + +const ImgList = struct { + small: ?[]const u8,//string + normal: ?[]const u8,//string + large: ?[]const u8,//string + png: ?[]const u8,//string + art_crop: ?[]const u8,//string + border_crop: ?[]const u8,//string +}; + diff --git a/out.md b/out.md new file mode 100644 index 0000000..28cba3f --- /dev/null +++ b/out.md @@ -0,0 +1,449 @@ +``` +| Abrupt Decay {B}{G} (Instant) | Anointed Peacekeeper {2}{W} | Archon of Emeria {2}{W} +| >> This spell can't be | (Creature — Human Cleric) | (Creature — Archon) >> +| countered. Destroy target | >> Vigilance As Anointed | Flying Each player can't cast +| nonland permanent with mana | Peacekeeper enters the | more than one spell each +| value 3 or less. | battlefield, look at an | turn. Nonbasic lands your +| | opponent's hand, then choose | opponents control enter the +| | any card name. Spells your | battlefield tapped. +| | opponents cast with the | +| | chosen name cost {2} more to | +| | cast. Activated abilities of | +| | sources with the chosen name | +| | cost {2} more to activate | +| | unless they're mana | +| | abilities. | + +| Arid Mesa (Land) >> {T}, Pay | Ayara's Oathsworn {1}{B} | Badlands (Land — Swamp +| 1 life, Sacrifice Arid Mesa: | (Creature — Human Knight) | Mountain) >> ({T}: Add {B} or +| Search your library for a | >> Menace Whenever Ayara's | {R}.) +| Mountain or Plains card, put | Oathsworn deals combat damage | +| it onto the battlefield, then | to a player, if it has fewer | +| shuffle. | than four +1/+1 counters on | +| | it, put a +1/+1 counter on | +| | it. Then if it has exactly | +| | four +1/+1 counters on it, | +| | search your library for a | +| | card, put it into your hand, | +| | then shuffle. | + +| Bayou (Land — Swamp Forest) | Birds of Paradise {G} | Bloodstained Mire (Land) >> +| >> ({T}: Add {B} or {G}.) | (Creature — Bird) >> Flying | {T}, Pay 1 life, Sacrifice +| | {T}: Add one mana of any | Bloodstained Mire: Search +| | color. | your library for a Swamp or +| | | Mountain card, put it onto +| | | the battlefield, then +| | | shuffle. + +| Boseiju, Who Endures | Broadside Bombardiers {2}{R} | Cankerbloom {1}{G} (Creature +| (Legendary Land) >> {T}: Add | (Creature — Goblin Pirate) | — Phyrexian Fungus) >> {1}, +| {G}. Channel — {1}{G}, | >> Menace, haste Boast — | Sacrifice Cankerbloom: Choose +| Discard Boseiju, Who Endures: | Sacrifice another creature or | one — • Destroy target +| Destroy target artifact, | artifact: Broadside | artifact. • Destroy target +| enchantment, or nonbasic land | Bombardiers deals damage | enchantment. • Proliferate. +| an opponent controls. That | equal to 2 plus the | (Choose any number of +| player may search their | sacrificed permanent's mana | permanents and/or players, +| library for a land card with | value to any target. | then give each another +| a basic land type, put it | (Activate only if this | counter of each kind already +| onto the battlefield, then | creature attacked this turn | there.) +| shuffle. This ability costs | and only once each turn.) | +| {1} less to activate for each | | +| legendary creature you | | +| control. | | + +| Caves of Chaos Adventurer | Chrome Mox {0} (Artifact) >> | City of Brass (Land) >> +| {3}{R} (Creature — Human | Imprint — When Chrome Mox | Whenever City of Brass +| Barbarian) >> Trample When | enters the battlefield, you | becomes tapped, it deals 1 +| Caves of Chaos Adventurer | may exile a nonartifact, | damage to you. {T}: Add one +| enters the battlefield, you | nonland card from your hand. | mana of any color. +| take the initiative. Whenever | {T}: Add one mana of any of | +| Caves of Chaos Adventurer | the exiled card's colors. | +| attacks, exile the top card | | +| of your library. If you've | | +| completed a dungeon, you may | | +| play that card this turn | | +| without paying its mana cost. | | +| Otherwise, you may play that | | +| card this turn. | | + +| Comet, Stellar Pup {2}{R}{W} | Dark Confidant {1}{B} | Deathrite Shaman {B/G} +| (Legendary Planeswalker — | (Creature — Human Wizard) | (Creature — Elf Shaman) >> +| Comet) >> 0: Roll a six-sided | >> At the beginning of your | {T}: Exile target land card +| die. 1 or 2 — [+2], then | upkeep, reveal the top card | from a graveyard. Add one +| create two 1/1 green Squirrel | of your library and put that | mana of any color. {B}, {T}: +| creature tokens. They gain | card into your hand. You lose | Exile target instant or +| haste until end of turn. 3 | life equal to its mana value. | sorcery card from a +| — [−1], then return a | | graveyard. Each opponent +| card with mana value 2 or | | loses 2 life. {G}, {T}: Exile +| less from your graveyard to | | target creature card from a +| your hand. 4 or 5 — Comet, | | graveyard. You gain 2 life. +| Stellar Pup deals damage | | +| equal to the number of | | +| loyalty counters on him to a | | +| creature or player, then | | +| [−2]. 6 — [+1], and you | | +| may activate Comet, Stellar | | +| Pup's loyalty ability two | | +| more times this turn. | | + +| Duress {B} (Sorcery) >> | Eladamri's Call {G}{W} | Elvish Spirit Guide {2}{G} +| Target opponent reveals their | (Instant) >> Search your | (Creature — Elf Spirit) >> +| hand. You choose a | library for a creature card, | Exile Elvish Spirit Guide +| noncreature, nonland card | reveal that card, put it into | from your hand: Add {G}. +| from it. That player discards | your hand, then shuffle. | +| that card. | | + +| Endurance {1}{G}{G} (Creature | Fatal Push {B} (Instant) >> | Flooded Strand (Land) >> {T}, +| — Elemental Incarnation) >> | Destroy target creature if it | Pay 1 life, Sacrifice Flooded +| Flash Reach When Endurance | has mana value 2 or less. | Strand: Search your library +| enters the battlefield, up to | Revolt — Destroy that | for a Plains or Island card, +| one target player puts all | creature if it has mana value | put it onto the battlefield, +| the cards from their | 4 or less instead if a | then shuffle. +| graveyard on the bottom of | permanent you controlled left | +| their library in a random | the battlefield this turn. | +| order. Evoke—Exile a green | | +| card from your hand. | | + +| Forest (Basic Land — | Forth Eorlingas! {X}{R}{W} | Generous Ent {5}{G} (Creature +| Forest) >> ({T}: Add {G}.) | (Sorcery) >> Create X 2/2 red | — Treefolk) >> Reach When +| | Human Knight creature tokens | Generous Ent enters the +| | with trample and haste. | battlefield, create a Food +| | Whenever one or more | token. (It's an artifact with +| | creatures you control deal | "{2}, {T}, Sacrifice this +| | combat damage to one or more | artifact: You gain 3 life.") +| | players this turn, you become | Forestcycling {1} ({1}, +| | the monarch. | Discard this card: Search +| | | your library for a Forest +| | | card, reveal it, put it into +| | | your hand, then shuffle.) + +| Gitaxian Probe {U/P} | Godless Shrine (Land — | Green Sun's Zenith {X}{G} +| (Sorcery) >> ({U/P} can be | Plains Swamp) >> ({T}: Add | (Sorcery) >> Search your +| paid with either {U} or 2 | {W} or {B}.) As Godless | library for a green creature +| life.) Look at target | Shrine enters the | card with mana value X or +| player's hand. Draw a card. | battlefield, you may pay 2 | less, put it onto the +| | life. If you don't, it enters | battlefield, then shuffle. +| | the battlefield tapped. | Shuffle Green Sun's Zenith +| | | into its owner's library. + +| Grist, the Hunger Tide | Hexdrinker {G} (Creature — | Ignoble Hierarch {G} +| {1}{B}{G} (Legendary | Snake) >> Level up {1} ({1}: | (Creature — Goblin Shaman) +| Planeswalker — Grist) >> As | Put a level counter on this. | >> Exalted (Whenever a +| long as Grist, the Hunger | Level up only as a sorcery.) | creature you control attacks +| Tide isn't on the | LEVEL 3-7 4/4 Protection from | alone, that creature gets +| battlefield, it's a 1/1 | instants LEVEL 8+ 6/6 | +1/+1 until end of turn.) +| Insect creature in addition | Protection from everything | {T}: Add {B}, {R}, or {G}. +| to its other types. +1: | | +| Create a 1/1 black and green | | +| Insect creature token, then | | +| mill a card. If an Insect | | +| card was milled this way, put | | +| a loyalty counter on Grist | | +| and repeat this process. | | +| −2: You may sacrifice a | | +| creature. When you do, | | +| destroy target creature or | | +| planeswalker. −5: Each | | +| opponent loses life equal to | | +| the number of creature cards | | +| in your graveyard. | | + +| Inquisition of Kozilek {B} | Inti, Seneschal of the Sun | Karakas (Legendary Land) >> +| (Sorcery) >> Target player | {1}{R} (Legendary Creature | {T}: Add {W}. {T}: Return +| reveals their hand. You | — Human Knight) >> Whenever | target legendary creature to +| choose a nonland card from it | you attack, you may discard a | its owner's hand. +| with mana value 3 or less. | card. When you do, put a | +| That player discards that | +1/+1 counter on target | +| card. | attacking creature. It gains | +| | trample until end of turn. | +| | Whenever you discard one or | +| | more cards, exile the top | +| | card of your library. You may | +| | play that card until your | +| | next end step. | + +| Kellan, Daring Traveler // | Laelia, the Blade Reforged | Legolas's Quick Reflexes {G} +| Journey On {1}{W} // {G} | {2}{R} (Legendary Creature | (Instant) >> Split second (As +| (Legendary Creature — Human | — Spirit Warrior) >> Haste | long as this spell is on the +| Faerie Scout // Sorcery — | Whenever Laelia, the Blade | stack, players can't cast +| Adventure) >> Whenever | Reforged attacks, exile the | spells or activate abilities +| Kellan, Daring Traveler | top card of your library. You | that aren't mana abilities.) +| attacks, reveal the top card | may play that card this turn. | Untap target creature. Until +| of your library. If it's a | Whenever one or more cards | end of turn, it gains +| creature card with mana value | are put into exile from your | hexproof, reach, and +| 3 or less, put it into your | library and/or your | "Whenever this creature +| hand. Otherwise, you may put | graveyard, put a +1/+1 | becomes tapped, it deals +| it into your graveyard. // | counter on Laelia. | damage equal to its power to +| Create X Map tokens, where X | | up to one target creature." +| is one plus the number of | | +| opponents who control an | | +| artifact. (Then exile this | | +| card. You may cast the | | +| creature later from exile.) | | + +| Leyline Binding {5}{W} | Lord Skitter, Sewer King | Lotus Petal {0} (Artifact) >> +| (Enchantment) >> Flash Domain | {2}{B} (Legendary Creature | {T}, Sacrifice Lotus Petal: +| — This spell costs {1} less | — Rat Noble) >> Whenever | Add one mana of any color. +| to cast for each basic land | another Rat enters the | +| type among lands you control. | battlefield under your | +| When Leyline Binding enters | control, exile up to one | +| the battlefield, exile target | target card from an | +| nonland permanent an opponent | opponent's graveyard. At the | +| controls until Leyline | beginning of combat on your | +| Binding leaves the | turn, create a 1/1 black Rat | +| battlefield. | creature token with "This | +| | creature can't block." | + +| Luminarch Aspirant {1}{W} | Mana Confluence (Land) >> | Marsh Flats (Land) >> {T}, +| (Creature — Human Cleric) | {T}, Pay 1 life: Add one mana | Pay 1 life, Sacrifice Marsh +| >> At the beginning of combat | of any color. | Flats: Search your library +| on your turn, put a +1/+1 | | for a Plains or Swamp card, +| counter on target creature | | put it onto the battlefield, +| you control. | | then shuffle. + +| Mawloc {X}{R}{G} (Creature | Mental Misstep {U/P} | Minsc & Boo, Timeless Heroes +| — Tyranid) >> Ravenous | (Instant) >> ({U/P} can be | {2}{R}{G} (Legendary +| (This creature enters the | paid with either {U} or 2 | Planeswalker — Minsc) >> +| battlefield with X +1/+1 | life.) Counter target spell | When Minsc & Boo, Timeless +| counters on it. If X is 5 or | with mana value 1. | Heroes enters the battlefield +| more, draw a card when it | | and at the beginning of your +| enters.) Terror from the Deep | | upkeep, you may create Boo, a +| — When Mawloc enters the | | legendary 1/1 red Hamster +| battlefield, it fights up to | | creature token with trample +| one target creature an | | and haste. +1: Put three +| opponent controls. If that | | +1/+1 counters on up to one +| creature would die this turn, | | target creature with trample +| exile it instead. | | or haste. −2: Sacrifice a +| | | creature. When you do, Minsc +| | | & Boo, Timeless Heroes deals +| | | X damage to any target, where +| | | X is that creature's power. +| | | If the sacrificed creature +| | | was a Hamster, draw X cards. +| | | Minsc & Boo, Timeless Heroes +| | | can be your commander. + +| Misty Rainforest (Land) >> | Mosswood Dreadknight // Dread | Mother of Runes {W} (Creature +| {T}, Pay 1 life, Sacrifice | Whispers {1}{G} // {1}{B} | — Human Cleric) >> {T}: +| Misty Rainforest: Search your | (Creature — Human Knight // | Target creature you control +| library for a Forest or | Sorcery — Adventure) >> | gains protection from the +| Island card, put it onto the | Trample When Mosswood | color of your choice until +| battlefield, then shuffle. | Dreadknight dies, you may | end of turn. +| | cast it from your graveyard | +| | as an Adventure until the end | +| | of your next turn. // You | +| | draw a card and you lose 1 | +| | life. (Then exile this card. | +| | You may cast the creature | +| | later from exile.) | + +| Mox Diamond {0} (Artifact) >> | Mox Emerald {0} (Artifact) >> | Mox Jet {0} (Artifact) >> +| If Mox Diamond would enter | {T}: Add {G}. | {T}: Add {B}. +| the battlefield, you may | | +| discard a land card instead. | | +| If you do, put Mox Diamond | | +| onto the battlefield. If you | | +| don't, put it into its | | +| owner's graveyard. {T}: Add | | +| one mana of any color. | | + +| Mox Pearl {0} (Artifact) >> | Noble Hierarch {G} (Creature | Once Upon a Time {1}{G} +| {T}: Add {W}. | — Human Druid) >> Exalted | (Instant) >> If this spell is +| | (Whenever a creature you | the first spell you've cast +| | control attacks alone, that | this game, you may cast it +| | creature gets +1/+1 until end | without paying its mana cost. +| | of turn.) {T}: Add {G}, {W}, | Look at the top five cards of +| | or {U}. | your library. You may reveal +| | | a creature or land card from +| | | among them and put it into +| | | your hand. Put the rest on +| | | the bottom of your library in +| | | a random order. + +| Opposition Agent {2}{B} | Orcish Bowmasters {1}{B} | Overgrown Tomb (Land — +| (Creature — Human Rogue) >> | (Creature — Orc Archer) >> | Swamp Forest) >> ({T}: Add +| Flash You control your | Flash When Orcish Bowmasters | {B} or {G}.) As Overgrown +| opponents while they're | enters the battlefield and | Tomb enters the battlefield, +| searching their libraries. | whenever an opponent draws a | you may pay 2 life. If you +| While an opponent is | card except the first one | don't, it enters the +| searching their library, they | they draw in each of their | battlefield tapped. +| exile each card they find. | draw steps, Orcish Bowmasters | +| You may play those cards for | deals 1 damage to any target. | +| as long as they remain | Then amass Orcs 1. | +| exiled, and you may spend | | +| mana as though it were mana | | +| of any color to cast them. | | + +| Path to Exile {W} (Instant) | Plains (Basic Land — | Plateau (Land — Mountain +| >> Exile target creature. Its | Plains) >> ({T}: Add {W}.) | Plains) >> ({T}: Add {R} or +| controller may search their | | {W}.) +| library for a basic land | | +| card, put that card onto the | | +| battlefield tapped, then | | +| shuffle. | | + +| Polluted Delta (Land) >> {T}, | Prismatic Ending {X}{W} | Prismatic Vista (Land) >> +| Pay 1 life, Sacrifice | (Sorcery) >> Converge — | {T}, Pay 1 life, Sacrifice +| Polluted Delta: Search your | Exile target nonland | Prismatic Vista: Search your +| library for an Island or | permanent if its mana value | library for a basic land +| Swamp card, put it onto the | is less than or equal to the | card, put it onto the +| battlefield, then shuffle. | number of colors of mana | battlefield, then shuffle. +| | spent to cast this spell. | + +| Questing Beast {2}{G}{G} | Razorverge Thicket (Land) >> | Reanimate {B} (Sorcery) >> +| (Legendary Creature — | Razorverge Thicket enters the | Put target creature card from +| Beast) >> Vigilance, | battlefield tapped unless you | a graveyard onto the +| deathtouch, haste Questing | control two or fewer other | battlefield under your +| Beast can't be blocked by | lands. {T}: Add {G} or {W}. | control. You lose life equal +| creatures with power 2 or | | to its mana value. +| less. Combat damage that | | +| would be dealt by creatures | | +| you control can't be | | +| prevented. Whenever Questing | | +| Beast deals combat damage to | | +| an opponent, it deals that | | +| much damage to target | | +| planeswalker that player | | +| controls. | | + +| Savannah (Land — Forest | Scalding Tarn (Land) >> {T}, | Scavenging Ooze {1}{G} +| Plains) >> ({T}: Add {G} or | Pay 1 life, Sacrifice | (Creature — Ooze) >> {G}: +| {W}.) | Scalding Tarn: Search your | Exile target card from a +| | library for an Island or | graveyard. If it was a +| | Mountain card, put it onto | creature card, put a +1/+1 +| | the battlefield, then | counter on Scavenging Ooze +| | shuffle. | and you gain 1 life. + +| Scrubland (Land — Plains | Seasoned Dungeoneer {3}{W} | Sentinel of the Nameless City +| Swamp) >> ({T}: Add {W} or | (Creature — Human Warrior) | {2}{G} (Creature — Merfolk +| {B}.) | >> When Seasoned Dungeoneer | Warrior Scout) >> Vigilance +| | enters the battlefield, you | Whenever Sentinel of the +| | take the initiative. Whenever | Nameless City enters the +| | you attack, target attacking | battlefield or attacks, +| | Cleric, Rogue, Warrior, or | create a Map token. (It's an +| | Wizard gains protection from | artifact with "{1}, {T}, +| | creatures until end of turn. | Sacrifice this artifact: +| | It explores. (Reveal the top | Target creature you control +| | card of your library. Put | explores. Activate only as a +| | that card into your hand if | sorcery.") +| | it's a land. Otherwise, put a | +| | +1/+1 counter on the | +| | creature, then put the card | +| | back or put it into your | +| | graveyard.) | + +| Shadowspear {1} (Legendary | Simian Spirit Guide {2}{R} | Stomping Ground (Land — +| Artifact — Equipment) >> | (Creature — Ape Spirit) >> | Mountain Forest) >> ({T}: Add +| Equipped creature gets +1/+1 | Exile Simian Spirit Guide | {R} or {G}.) As Stomping +| and has trample and lifelink. | from your hand: Add {R}. | Ground enters the +| {1}: Permanents your | | battlefield, you may pay 2 +| opponents control lose | | life. If you don't, it enters +| hexproof and indestructible | | the battlefield tapped. +| until end of turn. Equip {2} | | + +| Sungold Sentinel {1}{W} | Swamp (Basic Land — Swamp) | Swords to Plowshares {W} +| (Creature — Human Soldier) | >> ({T}: Add {B}.) | (Instant) >> Exile target +| >> Whenever Sungold Sentinel | | creature. Its controller +| enters the battlefield or | | gains life equal to its +| attacks, exile up to one | | power. +| target card from a graveyard. | | +| Coven — {1}{W}: Choose a | | +| color. Sungold Sentinel gains | | +| hexproof from that color | | +| until end of turn and can't | | +| be blocked by creatures of | | +| that color this turn. | | +| Activate only if you control | | +| three or more creatures with | | +| different powers. | | + +| Taiga (Land — Mountain | Tarmogoyf {1}{G} (Creature | Temple Garden (Land — +| Forest) >> ({T}: Add {R} or | — Lhurgoyf) >> Tarmogoyf's | Forest Plains) >> ({T}: Add +| {G}.) | power is equal to the number | {G} or {W}.) As Temple Garden +| | of card types among cards in | enters the battlefield, you +| | all graveyards and its | may pay 2 life. If you don't, +| | toughness is equal to that | it enters the battlefield +| | number plus 1. | tapped. + +| Tenth District Hero {1}{W} | Thalia, Guardian of Thraben | Thalia, Heretic Cathar {2}{W} +| (Creature — Human) >> | {1}{W} (Legendary Creature | (Legendary Creature — Human +| {1}{W}, Collect evidence 2: | — Human Soldier) >> First | Soldier) >> First strike +| Tenth District Hero becomes a | strike Noncreature spells | Creatures and nonbasic lands +| Human Detective with base | cost {1} more to cast. | your opponents control enter +| power and toughness 4/4 and | | the battlefield tapped. +| gains vigilance. {2}{W}, | | +| Collect evidence 4: If Tenth | | +| District Hero is a Detective, | | +| it becomes a legendary | | +| creature named Mileva, the | | +| Stalwart, it has base power | | +| and toughness 5/5, and it | | +| gains "Other creatures you | | +| control have indestructible." | | + +| Thoughtseize {B} (Sorcery) >> | Tidehollow Sculler {W}{B} | Troll of Khazad-dûm {5}{B} +| Target player reveals their | (Artifact Creature — | (Creature — Troll) >> Troll +| hand. You choose a nonland | Zombie) >> When Tidehollow | of Khazad-dûm can't be +| card from it. That player | Sculler enters the | blocked except by three or +| discards that card. You lose | battlefield, target opponent | more creatures. Swampcycling +| 2 life. | reveals their hand and you | {1} ({1}, Discard this card: +| | choose a nonland card from | Search your library for a +| | it. Exile that card. When | Swamp card, reveal it, put it +| | Tidehollow Sculler leaves the | into your hand, then +| | battlefield, return the | shuffle.) +| | exiled card to its owner's | +| | hand. | + +| Underground Mortuary (Land | Undermountain Adventurer | Unearth {B} (Sorcery) >> +| — Swamp Forest) >> ({T}: | {3}{G} (Creature — Giant | Return target creature card +| Add {B} or {G}.) Underground | Warrior) >> Vigilance When | with mana value 3 or less +| Mortuary enters the | Undermountain Adventurer | from your graveyard to the +| battlefield tapped. When | enters the battlefield, you | battlefield. Cycling {2} +| Underground Mortuary enters | take the initiative. {T}: Add | ({2}, Discard this card: Draw +| the battlefield, surveil 1. | {G}{G}. If you've completed a | a card.) +| (Look at the top card of your | dungeon, add six {G} instead. | +| library. You may put it into | | +| your graveyard.) | | + +| Verdant Catacombs (Land) >> | Wasteland (Land) >> {T}: Add | White Plume Adventurer {2}{W} +| {T}, Pay 1 life, Sacrifice | {C}. {T}, Sacrifice | (Creature — Orc Cleric) >> +| Verdant Catacombs: Search | Wasteland: Destroy target | When White Plume Adventurer +| your library for a Swamp or | nonbasic land. | enters the battlefield, you +| Forest card, put it onto the | | take the initiative. At the +| battlefield, then shuffle. | | beginning of each opponent's +| | | upkeep, untap a creature you +| | | control. If you've completed +| | | a dungeon, untap all +| | | creatures you control +| | | instead. + +| Windswept Heath (Land) >> | Witherbloom Command {B}{G} | Wooded Foothills (Land) >> +| {T}, Pay 1 life, Sacrifice | (Sorcery) >> Choose two — | {T}, Pay 1 life, Sacrifice +| Windswept Heath: Search your | • Target player mills three | Wooded Foothills: Search your +| library for a Forest or | cards, then you return a land | library for a Mountain or +| Plains card, put it onto the | card from your graveyard to | Forest card, put it onto the +| battlefield, then shuffle. | your hand. • Destroy target | battlefield, then shuffle. +| | noncreature, nonland | +| | permanent with mana value 2 | +| | or less. • Target creature | +| | gets -3/-1 until end of turn. | +| | • Target opponent loses 2 | +| | life and you gain 2 life. | + +| Wrenn and Six {R}{G} | | +| (Legendary Planeswalker — | | +| Wrenn) >> +1: Return up to | | +| one target land card from | | +| your graveyard to your hand. | | +| −1: Wrenn and Six deals 1 | | +| damage to any target. −7: | | +| You get an emblem with | | +| "Instant and sorcery cards in | | +| your graveyard have retrace." | | +| (You may cast instant and | | +| sorcery cards from your | | +| graveyard by discarding a | | +| land card in addition to | | +| paying their other costs.) | | + +``` diff --git a/out.pdf b/out.pdf new file mode 100644 index 0000000..5a27b10 Binary files /dev/null and b/out.pdf differ diff --git a/print.zig b/print.zig index 224cbaa..1a5e75e 100644 --- a/print.zig +++ b/print.zig @@ -1,235 +1,215 @@ +//TODO: const std = @import("std"); +const clap = @import("clap"); const print = std.debug.print; const io = std.io; const fs = std.fs; const json = std.json; const cwd = fs.cwd(); - -const ImgList = struct { - small: ?[]const u8,//string - normal: ?[]const u8,//string - large: ?[]const u8,//string - png: ?[]const u8,//string - art_crop: ?[]const u8,//string - border_crop: ?[]const u8,//string -}; - -const Legalities = struct { - standard: ?[]const u8,//string - future: ?[]const u8,//string - historic: ?[]const u8,//string - timeless: ?[]const u8,//string - gladiator: ?[]const u8,//string - pioneer: ?[]const u8,//string - explorer: ?[]const u8,//string - modern: ?[]const u8,//string - legacy: ?[]const u8,//string - pauper: ?[]const u8,//string - vintage: ?[]const u8,//string - penny: ?[]const u8,//string - commander: ?[]const u8,//string - oathbreaker:?[]const u8,//string - standardbrawl:?[]const u8,//string - brawl: ?[]const u8,//string - alchemy: ?[]const u8,//string - paupercommander:?[]const u8,//string - duel: ?[]const u8,//string - oldschool: ?[]const u8,//string - premodern: ?[]const u8,//string - predh: ?[]const u8,//string -}; - -const Prices = struct { - usd: ?[]const u8,//string? but technically a float - usd_foil: ?[]const u8,//same - usd_etched: ?[]const u8,//same - eur: ?[]const u8,//same - eur_foil: ?[]const u8,//same - tix: ?[]const u8,//same -}; - -const RelatedUris = struct { - gatherer: ?[]const u8,//string - tcgplayer_infinite_articles: ?[]const u8,//string - tcgplayer_infinite_decks: ?[]const u8,//string - edhrec: ?[]const u8,//string -}; - -const PurchaseUris = struct { - tcgplayer: ?[]const u8,//string - cardmarket: ?[]const u8,//string - cardhoarder: ?[]const u8,//string -}; - -const val_or_nothing = union(enum) { - none: void, - int: i32, - float: f64, - string: []const u8, -}; +const indexOf = std.mem.indexOf; +const expect = std.testing.expect; const Card = struct { - // object: ?[]const u8,//string - // id: ?[]const u8,//string - // oracle_id: ?[]const u8,//string - // multiverse_ids: ?[]u32,//array of int - // mtgo_id: ?u32,//int - // mtgo_foil_id: ?u32,//int - // tcgplayer_id: ?u32,//int - // cardmarket_id: ?u32,//int - name: ?[]const u8,//string - // lang: ?[]const u8,//string - // released_at: ?[]const u8,//string - // uri: ?[]const u8,//string - // scryfall_uri: ?[]const u8,//string - // layout: ?[]const u8,//string - // highres_image: ?bool,//bool - // image_status: ?[]const u8,//string - // image_uris: ?ImgList,//obj (strings) - // mana_cost: ?[]const u8,//string - cmc: ?f32,//technically a float? but I think we can always cast safely EDIT: NOPE - type_line: ?[]const u8,//string - oracle_text: ?[]const u8 = "",//string - // colors: json.Value,//?[]const u8,//array of Chars - color_identity: json.Value,//?[]const u8,//array of Chars - keywords: ?[][]const u8,//array of Strings - // legalities: ?Legalities,//obj (strings) - // games: ?[][]const u8,//array of Strings - // reserved: ?bool,//bool - // foil: ?bool,//bool - // nonfoil: ?bool,//bool - // finishes: ?[][]const u8,//array of Strings - // oversized: ?bool,//bool - // promo: ?bool,//bool - // reprint: ?bool,//bool - // variation: ?bool,//bool - // set_id: ?[]const u8,//string - // set: ?[]const u8,//string - // set_name: ?[]const u8,//string - // set_type: ?[]const u8,//string - // set_uri: ?[]const u8,//string - // set_search_uri: ?[]const u8,//string - // scryfall_set_uri: ?[]const u8,//string - // rulings_uri: ?[]const u8,//string - // prints_search_uri: ?[]const u8,//string - // collector_number: ?[]const u8,//string - // digital: ?bool,//bool - // rarity: ?[]const u8,//string - // flavor_text: ?[]const u8,//string - // card_back_id: ?[]const u8,//string - // artist: ?[]const u8,//string - // artist_ids: ?[][]const u8,//string - // illustration_id: ?[]const u8,//string - // border_color: ?[]const u8,//string - // frame: ?[]const u8,//string - // full_art: ?bool,//bool - // textless: ?bool,//bool - // booster: ?bool,//bool - // story_spotlight: ?bool,//bool - // edhrec_rank: ?u32,//int - // prices: ?Prices,//obj (floats stored as strings) - // related_uris: json.Value,//?RelatedUris,//obj (strings) - // purchase_uris: json.Value,//?PurchaseUris,//obj (strings) + name: []const u8 = "",//string + mana_cost: []const u8 = "",//string + cmc: f32 = 0,//technically a float? but I think we can always cast safely cast. EDIT: NOPE + type_line: []const u8 = "",//string + oracle_text: []const u8 = "",//string + card_faces: ?[]Card = null,//array of cards }; -pub fn main() !void { - - //const stdin = io.getStdIn().reader(); - const stdout = io.getStdOut().writer(); - const args = try std.process.argsAlloc(std.heap.page_allocator); - if (args.len < 2) return error.ExpectedArgument; - - const listFileName: []const u8 = args[1]; - const listFileSize = (try cwd.statFile(listFileName)).size; +const TextCard = struct { + text: [][]const u8, +}; + +const PandocOptions = &[_][]const u8{ + "pandoc", + "out.md", + "-o", "out.pdf", + "--pdf-engine", "xelatex", + "-V", "mainfont:Liberation Mono", + "-V", "geometry:margin=0cm" +}; + +const cardWidth = 30; +const cardHeight = 32; +const pageHeight = 66; +var heightMayVary = false; +const formatString = "{s: <" ++ std.fmt.digits2(cardWidth) ++ "}"; +//kind of ugly to look at but I wanted to emphasize that there is one space on either side of the formatted string +const lineFormatter = "|" ++ " " ++ formatString ++ " "; +const spacer: []const u8 = "|" ++ (" " ** (cardWidth + 2)); +const oracleFileName = "oracle-cards-20240205220208.js"; + +pub fn main() !void { + var args = try std.process.argsWithAllocator(std.heap.page_allocator); + + //handle program name argument + _ = args.next(); + const listFileName: []const u8 = args.next() orelse {return error.ExpectedArgument;}; + heightMayVary = stringToBool(args.next()); - const oracleFileName = "oracle-cards-20240205220208.js"; var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); defer arena.deinit(); const allocator = arena.allocator(); - - //================================= - // slice implementation - //================================= + const oracleFile = try cwd.openFile(oracleFileName, .{}); + var jsonReader = json.reader(allocator, oracleFile.reader()); + const parsedJson = try json.parseFromTokenSource([]Card, allocator, &jsonReader, .{.ignore_unknown_fields = true}); - // const oracleFileSize = (try cwd.statFile(oracleFileName)).size; - // const oracleBuf = try allocator.alloc(u8, oracleFileSize); - // const oracleString = try fs.cwd().readFile(oracleFileName, oracleBuf); - // const parsedJson = json.parseFromSlice([]Card, allocator, oracleString, .{.ignore_unknown_fields = true}); - // try stdout.print("{any}", .{parsedJson}); + var line = std.ArrayList(u8).init(allocator); + var cards = std.ArrayList(Card).init(allocator); + var rowToPrint = std.ArrayList(Card).init(allocator); + + const listReader = (try cwd.openFile(listFileName, .{})).reader(); - //================================== - // reader implementation - //================================== - - const oracleFile = try cwd.openFile(oracleFileName, .{}); - const oracleReader = oracleFile.reader(); - var diagnostics = json.Diagnostics{}; - // var jsonReader = json.reader(allocator, oracleReader); - var jsonReader = json.Reader(0x2000, @TypeOf(oracleReader)).init(allocator, oracleReader); - jsonReader.enableDiagnostics(&diagnostics); - const parsedJson = try json.parseFromTokenSource([]Card, allocator, &jsonReader, .{.ignore_unknown_fields = true}); - // if (parsedJson == error.InvalidCharacter) { - // try stdout.print("{s}\n", .{jsonReader.buffer}); - // try stdout.print("{any}\n", .{jsonReader.scanner.stack}); - // const cursorPos = jsonReader.scanner.cursor; - // try stdout.print("{s}\n", .{jsonReader.scanner.input}); - // try stdout.print("{d}\n", .{cursorPos}); - // try stdout.print("{c}\n", .{oracleString[cursorPos]}); - // } - try stdout.print("{?s}, {any}, {any}\n", .{parsedJson.value[0].oracle_text, diagnostics.getLine(), diagnostics.getColumn()}); + var allPrinted = std.ArrayList(u8).init(allocator); - //======= - // dynamic impl - //====== - - // const parsed = try json.parseFromSlice(json.Value, allocator, oracleString, .{}); - // defer parsed.deinit(); - // try stdout.print("{any}", .{parsed.value.array.items[0].string}); - // parsed.value.dump(); + while (listReader.streamUntilDelimiter(line.writer(), '\n', null)) { + defer line.clearRetainingCapacity(); + const cardName = line.items[indexOf(u8, line.items, " ").? + 1..indexOf(u8, line.items, "(").? - 1]; - const listBuf = try allocator.alloc(u8, listFileSize); - var word = std.ArrayList(u8).init(allocator); - //var line = std.ArrayList(u8).init(allocator); - var cardName = std.ArrayList(u8).init(allocator); - for (try fs.cwd().readFile(listFileName, listBuf)) |char| { - if(char != '\n' and char != ' ') { - try word.append(char); - } else { - //try stdout.print("{s}\n", .{word.items}); - if( - std.mem.indexOfAny(u8, word.items, "()0123456789") == null - ) { - try cardName.appendSlice(word.items); - try cardName.appendSlice(" "); - } - word.clearAndFree(); + // TODO: this seems rather pointlessly time-intensive + for(parsedJson.value) |cardObj| { + if (std.mem.eql(u8, cardObj.name, cardName)) { + try cards.append(cardObj); + } + } + } else |err| switch(err) { + error.EndOfStream => {}, + else => return err, + } + + + try sortCards(&cards); + //TODO (fixme): absolutely GARBAGE hack to get pandoc to preserve whitespace + try allPrinted.appendSlice("```\n"); + + for(cards.items) |cardObj| { + try rowToPrint.append(cardObj); + if(rowToPrint.items.len >= 3) { + try cardRow.print(allocator, rowToPrint.items, &allPrinted); + try allPrinted.append('\n'); + rowToPrint.clearAndFree(); } - // if (char != '\n' and (char < '0' or char > '9')) { - // try line.append(char); - // } - if (char == '\n') { - // try stdout.print("{s}\n", .{cardName.items}); - cardName.clearAndFree(); - //line.clearAndFree(); - } - //try stdout.print("{c}", .{char}); - } + } else { + try cardRow.print(allocator, rowToPrint.items, &allPrinted); + try allPrinted.append('\n'); + try allPrinted.appendSlice("```\n"); + std.debug.print("{s}", .{allPrinted.items}); + try cwd.writeFile2(.{.sub_path = "out.md", .data = allPrinted.items}); + rowToPrint.clearAndFree(); + var pandocProcess = std.ChildProcess.init(PandocOptions, allocator); + _ = try pandocProcess.spawnAndWait(); + } } -// fn findInTree(parent: anytype, tree: json.Value, query: []u8) json.Value { -// return switch(tree) |val| { -// .null, .bool, .integer, .float, .number_string, .string => { -// if(val == query) { -// parent -// } else { -// false -// } -// } else => { -// findInTree(val, val -// } -// }; -// } -// // fn testWord(allocator: []u8, check: anytype) !bool { +//TODO (fixme): card() needs an allocator... +fn compareTwo(_: void, a: Card, b: Card) bool { + return card(a).len > card(b).len; +} +fn sortCards(cards: *std.ArrayList(Card)) !void { + std.mem.sort(Card, cards.items, {}, compareTwo); +} + +fn card(allocator: std.mem.Allocator, cardObj: Card,) ![][]const u8 { + var cardText = std.ArrayList([]const u8).init(allocator); + + var fullUnformattedText = std.ArrayList(u8).init(allocator); + try fullUnformattedText.appendSlice(cardObj.name); + if(cardObj.mana_cost.len > 0) { + try fullUnformattedText.append(' '); + try fullUnformattedText.appendSlice(cardObj.mana_cost); + } + try fullUnformattedText.appendSlice(try std.mem.concat(allocator, u8, &[_][]const u8{ + " (", + cardObj.type_line, + ") >> " + })); + + try fullUnformattedText.appendSlice(cardObj.oracle_text); + + if(cardObj.card_faces) |faces| { + for(faces, 0..) |face, idx| { + try fullUnformattedText.appendSlice(face.oracle_text); + if(idx == 0) try fullUnformattedText.appendSlice(" // "); + } + } + + var line = std.ArrayList(u8).init(allocator); + var word = std.ArrayList(u8).init(allocator); + + for(fullUnformattedText.items) |char| { + try switch(char) { + '\n', ' ' => addWord(&word, &line, &cardText), + else => word.append(char) + }; + } else { + try addWord(&word, &line, &cardText); + try cardText.append(try line.toOwnedSlice()); + line.clearAndFree(); + } + while(!heightMayVary and cardText.items.len < cardHeight) { + try cardText.append(" " ** cardWidth); + } -// // } + return cardText.items; +} + +fn addWord(word: *std.ArrayList(u8), line: *std.ArrayList(u8), cardText: *std.ArrayList([]const u8)) !void { + if(line.items.len + word.items.len >= cardWidth) { + try cardText.append(try line.toOwnedSlice()); + line.clearAndFree(); + } + try line.appendSlice(word.items); + try line.append(' '); + word.clearAndFree(); +} + +const linesList = std.MultiArrayList(cardRow); +const cardRow = struct{ + first: []const u8 = spacer, + second: []const u8 = spacer, + third: []const u8 = spacer, + last: []const u8 = "\n", + fn print(allocator: std.mem.Allocator, cards: []Card, allPrinted: *std.ArrayList(u8)) !void { + var gpa = std.heap.GeneralPurposeAllocator(.{}){}; + + var lines = linesList{}; + defer lines.deinit(gpa.allocator()); + + for(cards, 0..) |cardObj, cardNo| { + const cardText = try card(allocator, cardObj); + for(cardText, 0..) |line, idx| { + const paddedLine = try std.fmt.allocPrint(gpa.allocator(), lineFormatter, .{line}); + const placeholder = if(idx < lines.items(.first).len) lines.get(idx) else cardRow{}; + const new: cardRow = switch(cardNo) { + 0 => .{.first = paddedLine}, + 1 => .{.first = placeholder.first, .second = paddedLine}, + 2 => .{.first = placeholder.first, .second = placeholder.second, .third = paddedLine}, + else => unreachable + }; + if(idx < lines.items(.first).len) { + lines.set(idx, new); + } else { + try lines.append(gpa.allocator(), new); + } + } + } + // const numRows = @mod(allPrinted.items.len, cardHeight); + // if((numRows + cardHeight) > + for(lines.items(.first), 0..) |_,idx| { + _ = lines.get(idx); + const line = lines.get(idx); + // std.debug.print("{s}{s}{s}\n", .{line.first, line.second, line.third}); + try allPrinted.appendSlice(line.first); + try allPrinted.appendSlice(line.second); + try allPrinted.appendSlice(line.third); + try allPrinted.appendSlice(line.last); + } + } +}; + +fn stringToBool(str: ?[]const u8) bool { + return std.mem.eql(u8, (str orelse "false"), "true"); +} diff --git a/src/main.zig b/src/main.zig new file mode 100644 index 0000000..c8a3f67 --- /dev/null +++ b/src/main.zig @@ -0,0 +1,24 @@ +const std = @import("std"); + +pub fn main() !void { + // Prints to stderr (it's a shortcut based on `std.io.getStdErr()`) + std.debug.print("All your {s} are belong to us.\n", .{"codebase"}); + + // stdout is for the actual output of your application, for example if you + // are implementing gzip, then only the compressed bytes should be sent to + // stdout, not any debugging messages. + const stdout_file = std.io.getStdOut().writer(); + var bw = std.io.bufferedWriter(stdout_file); + const stdout = bw.writer(); + + try stdout.print("Run `zig build test` to run the tests.\n", .{}); + + try bw.flush(); // don't forget to flush! +} + +test "simple test" { + var list = std.ArrayList(i32).init(std.testing.allocator); + defer list.deinit(); // try commenting this out and see if zig detects the memory leak! + try list.append(42); + try std.testing.expectEqual(@as(i32, 42), list.pop()); +} diff --git a/src/root.zig b/src/root.zig new file mode 100644 index 0000000..ecfeade --- /dev/null +++ b/src/root.zig @@ -0,0 +1,10 @@ +const std = @import("std"); +const testing = std.testing; + +export fn add(a: i32, b: i32) i32 { + return a + b; +} + +test "basic add functionality" { + try testing.expect(add(3, 7) == 10); +} diff --git a/test-list.zig b/test-list.zig new file mode 100644 index 0000000..1bb1c83 --- /dev/null +++ b/test-list.zig @@ -0,0 +1,36 @@ +const std = @import("std"); + +const defaultString = "deef"; +const structOfString = struct { + first: []const u8 = defaultString, + last: []const u8 = defaultString, +}; + +const listOfStruct = std.MultiArrayList(structOfString); + +const testStrings = [_][]const u8{ + "foo", + "bar", + "baz", + "foz" +}; + +pub fn main() !void { + var gpa = std.heap.GeneralPurposeAllocator(.{}){}; + + var list = listOfStruct{}; + defer list.deinit(gpa.allocator()); + + for(testStrings, 0..) |line, idx| { + const paddedLine = try std.fmt.allocPrint(gpa.allocator(), "{s: ^10}", .{line}); + const new = switch(idx) { + 0 => structOfString{.first = paddedLine}, + else => structOfString{}, + }; + std.debug.print("new: {s}\n", .{new.first}); + try list.append(gpa.allocator(), new); + } + for(list.items(.first), list.items(.last)) |first, last| { + std.debug.print("existing: {s}, {s}\n", .{first, last}); + } +} diff --git a/zig-cache/h/3f66aeb3589e602db9a047107481d520.txt b/zig-cache/h/3f66aeb3589e602db9a047107481d520.txt new file mode 100644 index 0000000..38eafb1 --- /dev/null +++ b/zig-cache/h/3f66aeb3589e602db9a047107481d520.txt @@ -0,0 +1,84 @@ +0 +915 27981523 1716085232847824128 06c37faa2c67ab9ff12c449adaef9a72 0 src/main.zig +43550 28374519 1716085224634631478 3ab943b2f5b3c1818a510df3f5ac703b 0 /home/lumenk/.cache/zig/p/1220e4669d29190ac809cd3a7726c20b6b49ea7425b7b89cab16d4dc3172016982bc/src/msgpack.zig +7737 27318955 1713603314000000000 7b4fdc315806ebffede643f9f98b8a50 1 std/std.zig +22535 27318953 1713603314000000000 e6ad8dc95efc97b95f3e7a7a376609ed 1 std/start.zig +114688 27318681 1713603314000000000 74fed2adb072da5aa83db559d086ae03 1 std/debug.zig +3029 27981506 1716078080330515222 d4f8021bcaf9bf87e5116fb2ee0918d2 0 /home/lumenk/.cache/zig/b/d4f8021bcaf9bf87e5116fb2ee0918d2/builtin.zig +32857 27318555 1713603314000000000 27f83ca4ce0566be7b92758ba27a8211 1 std/builtin.zig +89004 27318535 1713603314000000000 a1c652a6fa3579931aef32757683dd51 1 std/Target.zig +115070 27318533 1713603314000000000 fd7b7a619f52f1adcab5476bcd104cac 1 std/Target/x86.zig +78183 27318854 1713603314000000000 48254a64531cc6cc9f3b229c5da1c0f3 1 std/math.zig +41112 27318858 1713603314000000000 80e4c760c5fa7125765c8aaa802d9184 1 std/meta.zig +11091 27318511 1713603314000000000 3b4e837c9f6b3b4fbb5b3b95148e553c 1 std/SemanticVersion.zig +61526 27318694 1713603314000000000 00003d31510dec096134200d0d6ceecc 1 std/elf.zig +12295 27318940 1713603314000000000 603da58dea31db92bad2b93349f088c2 1 std/os.zig +207301 27318889 1713603314000000000 c6c89a113e8da2263ca7989b2cdf44a3 1 std/os/linux.zig +12494 27318885 1713603314000000000 e9933b000fa707703dab8f2fe68b002a 1 std/os/linux/tls.zig +292924 27318944 1713603314000000000 1db97817ddf9d5b1d7ab471e15a95db8 1 std/posix.zig +25504 27318771 1713603314000000000 0d380feec771d277d38493250815b334 1 std/io.zig +35896 27318716 1713603314000000000 fe6ca890c29b51018c25e7269898a5f5 1 std/fs.zig +63631 27318711 1713603314000000000 8ad62418ac37873a457da68a3e6d1cbd 1 std/fs/File.zig +1299 27318758 1713603314000000000 9ea5eaf4f2d36e2273f3ecec7f813b61 1 std/io/buffered_writer.zig +2259 27318753 1713603314000000000 d0332ba9399d02f163b9033b979acb28 1 std/io/Writer.zig +8365 27318788 1713603314000000000 1e96c9d448e9ae1d3162881bf730b07e 1 std/log.zig +176517 27318856 1713603314000000000 fd9bed600bb45bc220c548e689e7ebf9 1 std/mem.zig +13319 27318927 1713603314000000000 0ecb167cdc15eca0651fa6c248c99804 1 std/os/wasi.zig +12352 27318680 1713603314000000000 85ba4034d104ed83a45a1bb6ea2f588a 1 std/crypto.zig +105663 27318708 1713603314000000000 8d4becc343bcd3adac05a9906326c6df 1 std/fmt.zig +6209 27318676 1713603314000000000 89d4ae344badeeee363daef10bc5ad3f 1 std/crypto/tlcsprng.zig +54025 27318544 1713603314000000000 8c07809522884083ee986e616b3dbe11 1 std/Thread.zig +10030 27318538 1713603314000000000 6ec4900de2fa66c512d3a1a8b197182b 1 std/Thread/Mutex.zig +19056 27318549 1713603314000000000 fbe5a337296572a6d62cbde681c465ea 1 std/atomic.zig +13626 27318855 1713603314000000000 98c52b2fa05c32ad77f1743a5f3383ee 1 std/mem/Allocator.zig +90072 27318731 1713603314000000000 bffdf0affa202d9bafbc94cdc1368f10 1 std/hash_map.zig +5237 27318770 1713603314000000000 1ffe030ee2cb56e3f4f0730c76a43a35 1 std/io/tty.zig +112733 27318692 1713603314000000000 6a3c4b87759cf30d9e7a65625e6143a3 1 std/dwarf.zig +55565 27318695 1713603314000000000 70d775478d92cce6032146b76e8b8314 1 std/enums.zig +87217 27318547 1713603314000000000 d82200bd8e9f05406e233eef46e48149 1 std/array_list.zig +114248 27318546 1713603314000000000 7aa5a3d5d7c75f7861328581549e6a5d 1 std/array_hash_map.zig +38005 27318859 1713603314000000000 2df15a06c9368a128b68d617837153ef 1 std/multi_array_list.zig +111536 27318710 1713603314000000000 04f568f3193c7bb5986efc4ec52bfd91 1 std/fs/Dir.zig +1730 27318730 1713603314000000000 36cb1b0b5e0bb7d10f9b200b0a751743 1 std/hash.zig +19864 27318724 1713603314000000000 e3e11ead12f4f8bc5a4a39618951d77d 1 std/hash/crc.zig +7844 27318722 1713603314000000000 dae49ec27edbdf6d4a70a92a1d8f6614 1 std/hash/crc/impl.zig +6449 27318764 1713603314000000000 3bcfe7862cea857ee79939a098991ad5 1 std/io/fixed_buffer_stream.zig +14434 27318752 1713603314000000000 2655b33c088dd930683d9eb843eaceb4 1 std/io/Reader.zig +2057 27318608 1713603314000000000 a778ec13ef93e0ace847f52f066441fd 1 std/compress.zig +3736 27318600 1713603314000000000 a5c9eee5eaf5943e22c8a03fac3f2841 1 std/compress/zlib.zig +23371 27318585 1713603314000000000 9114b9a4ebd2dc71d31987c5fc13b8ba 1 std/compress/flate/inflate.zig +7460 27318581 1713603314000000000 1c1d1c1c4e61c64090b7ace80a4c2dab 1 std/compress/flate/container.zig +16625 27318577 1713603314000000000 8ba4aa19f03596c0d0eb18045a7331e8 1 std/compress/flate/bit_reader.zig +7434 27318573 1713603314000000000 a6347ffd91bdf7b166947d627e9f38c5 1 std/compress/flate/CircularBuffer.zig +3519 27318718 1713603314000000000 4e3c7d701979e5945ab9f85fed59a579 1 std/hash/adler.zig +10966 27318583 1713603314000000000 e24401bc06abbf873844211e243f0871 1 std/compress/flate/huffman_decoder.zig +77139 27318713 1713603314000000000 6ed68741d6922f90c45c6c388b6cdd8c 1 std/fs/path.zig +1399 27318685 1713603314000000000 40a7d4ac60d12c6e9ca294acaed35474 1 std/dwarf/FORM.zig +3900 27318688 1713603314000000000 b5711d1b73e43c5aaea25647f88f9369 1 std/dwarf/TAG.zig +7395 27318682 1713603314000000000 0736a520f4793791a2cfc257bfcfd3b6 1 std/dwarf/AT.zig +643 27318684 1713603314000000000 6f6a9e4e1602df062ad02179710971c4 1 std/dwarf/EH.zig +1884 27318843 1713603314000000000 4e39bcecc218a8cefd7304859e028778 1 std/math/log2.zig +12563 27318888 1713603314000000000 edca846565ef855c728e7372feed8676 1 std/os/linux/x86_64.zig +87942 27318882 1713603314000000000 2082c17ae271b44b3575bcdb700a983d 1 std/os/linux/syscalls.zig +31762 27318742 1713603314000000000 39822c5f2ad237650217b35e72989b75 1 std/heap.zig +12747 27318736 1713603314000000000 0c84990d94912da71f88ccdd844ff032 1 std/heap/arena_allocator.zig +14239 27318787 1713603314000000000 a69e9fd3810cdd1601c26dd47210af71 1 std/linked_list.zig +3726 27318732 1713603314000000000 d141686f91270c1ac884745688b966f5 1 std/heap/PageAllocator.zig +65714 27318947 1713603314000000000 ce544a97419b31ef988f4ec4c99eb39a 1 std/process.zig +29773 27318952 1713603314000000000 6e96f5117f2db4b1f67515385b4cbc04 1 std/sort.zig +51714 27318950 1713603314000000000 eb8790d984ce4a6ddd6376d877c85ff1 1 std/sort/block.zig +17014 27318693 1713603314000000000 b0e0b21898d4115f9772e9cddc07b2b7 1 std/dynamic_library.zig +80096 27318966 1713603314000000000 dcae88764146b76769ce525b262e7a9a 1 std/unicode.zig +23315 27318949 1713603314000000000 ffbdbe729df38f396c8bfb00dd14e4d7 1 std/simd.zig +17851 27318786 1713603314000000000 62510503fe6b45659189d32c19c9dc45 1 std/leb128.zig +10710 27318951 1713603314000000000 f2973ab2be6115a15cf6c75a2be36ad3 1 std/sort/pdq.zig +10091 27318969 1713603314000000000 616a2d791eb8d67329f8198701e2bbad 1 std/valgrind.zig +19546 27318689 1713603314000000000 eeb537ce254d8635c5876f3cb23ba2ab 1 std/dwarf/abi.zig +26403 27318690 1713603314000000000 17cfec6893f0195cf3f2128e131aebbd 1 std/dwarf/call_frame.zig +71838 27318691 1713603314000000000 472566d679006f02ce08a8e6d3ca5840 1 std/dwarf/expressions.zig +43084 27318537 1713603314000000000 a67e9f409c649ae15d47dcc9582247f0 1 std/Thread/Futex.zig +13678 27318962 1713603314000000000 acfd077e4b0672dfb9bc1907ad8440ef 1 std/time.zig +1618 27318580 1713603314000000000 60e22c8a23680b34b51d27b486811807 1 std/compress/flate/consts.zig +13375 27318576 1713603314000000000 239244362ca7a3d92e32a4518ccda927 1 std/compress/flate/Token.zig +8372 27318728 1713603314000000000 d48498b32f349820311bbf338ae1aae5 1 std/hash/wyhash.zig +5693 27318687 1713603314000000000 01d731f8d28ba8382ff3c5885d5e0c75 1 std/dwarf/OP.zig diff --git a/zig-cache/h/76a6c38dd26adb56ff641fd82451e513.txt b/zig-cache/h/76a6c38dd26adb56ff641fd82451e513.txt new file mode 100644 index 0000000..4de7a3f --- /dev/null +++ b/zig-cache/h/76a6c38dd26adb56ff641fd82451e513.txt @@ -0,0 +1,81 @@ +0 +191 27981524 1716085232847824128 7e2860f081407d3d9f477662f7b2cd11 0 src/root.zig +7737 27318955 1713603314000000000 7b4fdc315806ebffede643f9f98b8a50 1 std/std.zig +22535 27318953 1713603314000000000 e6ad8dc95efc97b95f3e7a7a376609ed 1 std/start.zig +114688 27318681 1713603314000000000 74fed2adb072da5aa83db559d086ae03 1 std/debug.zig +3029 0 0 20a88d6f00a00f711831b6b38a5be557 0 /home/lumenk/.cache/zig/b/20a88d6f00a00f711831b6b38a5be557/builtin.zig +32857 27318555 1713603314000000000 27f83ca4ce0566be7b92758ba27a8211 1 std/builtin.zig +89004 27318535 1713603314000000000 a1c652a6fa3579931aef32757683dd51 1 std/Target.zig +115070 27318533 1713603314000000000 fd7b7a619f52f1adcab5476bcd104cac 1 std/Target/x86.zig +78183 27318854 1713603314000000000 48254a64531cc6cc9f3b229c5da1c0f3 1 std/math.zig +41112 27318858 1713603314000000000 80e4c760c5fa7125765c8aaa802d9184 1 std/meta.zig +11091 27318511 1713603314000000000 3b4e837c9f6b3b4fbb5b3b95148e553c 1 std/SemanticVersion.zig +12295 27318940 1713603314000000000 603da58dea31db92bad2b93349f088c2 1 std/os.zig +13319 27318927 1713603314000000000 0ecb167cdc15eca0651fa6c248c99804 1 std/os/wasi.zig +8365 27318788 1713603314000000000 1e96c9d448e9ae1d3162881bf730b07e 1 std/log.zig +12352 27318680 1713603314000000000 85ba4034d104ed83a45a1bb6ea2f588a 1 std/crypto.zig +35896 27318716 1713603314000000000 fe6ca890c29b51018c25e7269898a5f5 1 std/fs.zig +105663 27318708 1713603314000000000 8d4becc343bcd3adac05a9906326c6df 1 std/fmt.zig +6209 27318676 1713603314000000000 89d4ae344badeeee363daef10bc5ad3f 1 std/crypto/tlcsprng.zig +19056 27318549 1713603314000000000 fbe5a337296572a6d62cbde681c465ea 1 std/atomic.zig +54025 27318544 1713603314000000000 8c07809522884083ee986e616b3dbe11 1 std/Thread.zig +10030 27318538 1713603314000000000 6ec4900de2fa66c512d3a1a8b197182b 1 std/Thread/Mutex.zig +25504 27318771 1713603314000000000 0d380feec771d277d38493250815b334 1 std/io.zig +63631 27318711 1713603314000000000 8ad62418ac37873a457da68a3e6d1cbd 1 std/fs/File.zig +292924 27318944 1713603314000000000 1db97817ddf9d5b1d7ab471e15a95db8 1 std/posix.zig +207301 27318889 1713603314000000000 c6c89a113e8da2263ca7989b2cdf44a3 1 std/os/linux.zig +2259 27318753 1713603314000000000 d0332ba9399d02f163b9033b979acb28 1 std/io/Writer.zig +176517 27318856 1713603314000000000 fd9bed600bb45bc220c548e689e7ebf9 1 std/mem.zig +13626 27318855 1713603314000000000 98c52b2fa05c32ad77f1743a5f3383ee 1 std/mem/Allocator.zig +90072 27318731 1713603314000000000 bffdf0affa202d9bafbc94cdc1368f10 1 std/hash_map.zig +5237 27318770 1713603314000000000 1ffe030ee2cb56e3f4f0730c76a43a35 1 std/io/tty.zig +112733 27318692 1713603314000000000 6a3c4b87759cf30d9e7a65625e6143a3 1 std/dwarf.zig +55565 27318695 1713603314000000000 70d775478d92cce6032146b76e8b8314 1 std/enums.zig +87217 27318547 1713603314000000000 d82200bd8e9f05406e233eef46e48149 1 std/array_list.zig +114248 27318546 1713603314000000000 7aa5a3d5d7c75f7861328581549e6a5d 1 std/array_hash_map.zig +38005 27318859 1713603314000000000 2df15a06c9368a128b68d617837153ef 1 std/multi_array_list.zig +61526 27318694 1713603314000000000 00003d31510dec096134200d0d6ceecc 1 std/elf.zig +111536 27318710 1713603314000000000 04f568f3193c7bb5986efc4ec52bfd91 1 std/fs/Dir.zig +1730 27318730 1713603314000000000 36cb1b0b5e0bb7d10f9b200b0a751743 1 std/hash.zig +19864 27318724 1713603314000000000 e3e11ead12f4f8bc5a4a39618951d77d 1 std/hash/crc.zig +7844 27318722 1713603314000000000 dae49ec27edbdf6d4a70a92a1d8f6614 1 std/hash/crc/impl.zig +6449 27318764 1713603314000000000 3bcfe7862cea857ee79939a098991ad5 1 std/io/fixed_buffer_stream.zig +14434 27318752 1713603314000000000 2655b33c088dd930683d9eb843eaceb4 1 std/io/Reader.zig +2057 27318608 1713603314000000000 a778ec13ef93e0ace847f52f066441fd 1 std/compress.zig +3736 27318600 1713603314000000000 a5c9eee5eaf5943e22c8a03fac3f2841 1 std/compress/zlib.zig +23371 27318585 1713603314000000000 9114b9a4ebd2dc71d31987c5fc13b8ba 1 std/compress/flate/inflate.zig +7460 27318581 1713603314000000000 1c1d1c1c4e61c64090b7ace80a4c2dab 1 std/compress/flate/container.zig +16625 27318577 1713603314000000000 8ba4aa19f03596c0d0eb18045a7331e8 1 std/compress/flate/bit_reader.zig +7434 27318573 1713603314000000000 a6347ffd91bdf7b166947d627e9f38c5 1 std/compress/flate/CircularBuffer.zig +3519 27318718 1713603314000000000 4e3c7d701979e5945ab9f85fed59a579 1 std/hash/adler.zig +10966 27318583 1713603314000000000 e24401bc06abbf873844211e243f0871 1 std/compress/flate/huffman_decoder.zig +77139 27318713 1713603314000000000 6ed68741d6922f90c45c6c388b6cdd8c 1 std/fs/path.zig +1399 27318685 1713603314000000000 40a7d4ac60d12c6e9ca294acaed35474 1 std/dwarf/FORM.zig +3900 27318688 1713603314000000000 b5711d1b73e43c5aaea25647f88f9369 1 std/dwarf/TAG.zig +7395 27318682 1713603314000000000 0736a520f4793791a2cfc257bfcfd3b6 1 std/dwarf/AT.zig +643 27318684 1713603314000000000 6f6a9e4e1602df062ad02179710971c4 1 std/dwarf/EH.zig +1884 27318843 1713603314000000000 4e39bcecc218a8cefd7304859e028778 1 std/math/log2.zig +12563 27318888 1713603314000000000 edca846565ef855c728e7372feed8676 1 std/os/linux/x86_64.zig +19546 27318689 1713603314000000000 eeb537ce254d8635c5876f3cb23ba2ab 1 std/dwarf/abi.zig +26403 27318690 1713603314000000000 17cfec6893f0195cf3f2128e131aebbd 1 std/dwarf/call_frame.zig +71838 27318691 1713603314000000000 472566d679006f02ce08a8e6d3ca5840 1 std/dwarf/expressions.zig +43084 27318537 1713603314000000000 a67e9f409c649ae15d47dcc9582247f0 1 std/Thread/Futex.zig +80096 27318966 1713603314000000000 dcae88764146b76769ce525b262e7a9a 1 std/unicode.zig +23315 27318949 1713603314000000000 ffbdbe729df38f396c8bfb00dd14e4d7 1 std/simd.zig +87942 27318882 1713603314000000000 2082c17ae271b44b3575bcdb700a983d 1 std/os/linux/syscalls.zig +31762 27318742 1713603314000000000 39822c5f2ad237650217b35e72989b75 1 std/heap.zig +12747 27318736 1713603314000000000 0c84990d94912da71f88ccdd844ff032 1 std/heap/arena_allocator.zig +14239 27318787 1713603314000000000 a69e9fd3810cdd1601c26dd47210af71 1 std/linked_list.zig +3726 27318732 1713603314000000000 d141686f91270c1ac884745688b966f5 1 std/heap/PageAllocator.zig +65714 27318947 1713603314000000000 ce544a97419b31ef988f4ec4c99eb39a 1 std/process.zig +29773 27318952 1713603314000000000 6e96f5117f2db4b1f67515385b4cbc04 1 std/sort.zig +51714 27318950 1713603314000000000 eb8790d984ce4a6ddd6376d877c85ff1 1 std/sort/block.zig +17014 27318693 1713603314000000000 b0e0b21898d4115f9772e9cddc07b2b7 1 std/dynamic_library.zig +17851 27318786 1713603314000000000 62510503fe6b45659189d32c19c9dc45 1 std/leb128.zig +10710 27318951 1713603314000000000 f2973ab2be6115a15cf6c75a2be36ad3 1 std/sort/pdq.zig +10091 27318969 1713603314000000000 616a2d791eb8d67329f8198701e2bbad 1 std/valgrind.zig +13678 27318962 1713603314000000000 acfd077e4b0672dfb9bc1907ad8440ef 1 std/time.zig +1618 27318580 1713603314000000000 60e22c8a23680b34b51d27b486811807 1 std/compress/flate/consts.zig +13375 27318576 1713603314000000000 239244362ca7a3d92e32a4518ccda927 1 std/compress/flate/Token.zig +8372 27318728 1713603314000000000 d48498b32f349820311bbf338ae1aae5 1 std/hash/wyhash.zig +5693 27318687 1713603314000000000 01d731f8d28ba8382ff3c5885d5e0c75 1 std/dwarf/OP.zig diff --git a/zig-cache/h/d8af0089fc38b294aa8394342d34223e.txt b/zig-cache/h/d8af0089fc38b294aa8394342d34223e.txt new file mode 100644 index 0000000..bc2d91a --- /dev/null +++ b/zig-cache/h/d8af0089fc38b294aa8394342d34223e.txt @@ -0,0 +1,154 @@ +0 +52139 27294327 1713603314000000000 b6f8b702c35886de1586b7879c9d262f 1 compiler/build_runner.zig +4016 27981525 1716085399224984524 e96a76cfa1c3101fb0854707f45d383c 0 /home/lumenk/Documents/code/zig/proxy-print/build.zig +629 0 0 34a5b8ac3b722a91568b48fc06ed7531 2 o/94ff9ce473aa29fd9171e5eaf6ba8bc6/dependencies.zig +855 28374512 1716085224634631478 328b673e34e70eae621202368ffa568f 0 /home/lumenk/.cache/zig/p/1220e4669d29190ac809cd3a7726c20b6b49ea7425b7b89cab16d4dc3172016982bc/build.zig +7737 27318955 1713603314000000000 7b4fdc315806ebffede643f9f98b8a50 1 std/std.zig +22535 27318953 1713603314000000000 e6ad8dc95efc97b95f3e7a7a376609ed 1 std/start.zig +114688 27318681 1713603314000000000 74fed2adb072da5aa83db559d086ae03 1 std/debug.zig +3029 27981506 1716078080330515222 d4f8021bcaf9bf87e5116fb2ee0918d2 0 /home/lumenk/.cache/zig/b/d4f8021bcaf9bf87e5116fb2ee0918d2/builtin.zig +32857 27318555 1713603314000000000 27f83ca4ce0566be7b92758ba27a8211 1 std/builtin.zig +89004 27318535 1713603314000000000 a1c652a6fa3579931aef32757683dd51 1 std/Target.zig +115070 27318533 1713603314000000000 fd7b7a619f52f1adcab5476bcd104cac 1 std/Target/x86.zig +78183 27318854 1713603314000000000 48254a64531cc6cc9f3b229c5da1c0f3 1 std/math.zig +41112 27318858 1713603314000000000 80e4c760c5fa7125765c8aaa802d9184 1 std/meta.zig +11091 27318511 1713603314000000000 3b4e837c9f6b3b4fbb5b3b95148e553c 1 std/SemanticVersion.zig +61526 27318694 1713603314000000000 00003d31510dec096134200d0d6ceecc 1 std/elf.zig +12295 27318940 1713603314000000000 603da58dea31db92bad2b93349f088c2 1 std/os.zig +207301 27318889 1713603314000000000 c6c89a113e8da2263ca7989b2cdf44a3 1 std/os/linux.zig +12494 27318885 1713603314000000000 e9933b000fa707703dab8f2fe68b002a 1 std/os/linux/tls.zig +292924 27318944 1713603314000000000 1db97817ddf9d5b1d7ab471e15a95db8 1 std/posix.zig +31762 27318742 1713603314000000000 39822c5f2ad237650217b35e72989b75 1 std/heap.zig +12747 27318736 1713603314000000000 0c84990d94912da71f88ccdd844ff032 1 std/heap/arena_allocator.zig +176517 27318856 1713603314000000000 fd9bed600bb45bc220c548e689e7ebf9 1 std/mem.zig +13626 27318855 1713603314000000000 98c52b2fa05c32ad77f1743a5f3383ee 1 std/mem/Allocator.zig +14239 27318787 1713603314000000000 a69e9fd3810cdd1601c26dd47210af71 1 std/linked_list.zig +3726 27318732 1713603314000000000 d141686f91270c1ac884745688b966f5 1 std/heap/PageAllocator.zig +1301 27318733 1713603314000000000 3db24c00baa9c03a40bfeaa152e28593 1 std/heap/ThreadSafeAllocator.zig +54025 27318544 1713603314000000000 8c07809522884083ee986e616b3dbe11 1 std/Thread.zig +10030 27318538 1713603314000000000 6ec4900de2fa66c512d3a1a8b197182b 1 std/Thread/Mutex.zig +19056 27318549 1713603314000000000 fbe5a337296572a6d62cbde681c465ea 1 std/atomic.zig +65714 27318947 1713603314000000000 ce544a97419b31ef988f4ec4c99eb39a 1 std/process.zig +87217 27318547 1713603314000000000 d82200bd8e9f05406e233eef46e48149 1 std/array_list.zig +94169 27318494 1713603314000000000 fddb6fe97673cb56a45801382be6cc40 1 std/Build.zig +47439 27318477 1713603314000000000 c6a86620d14b9e41af3f13862bda0acb 1 std/Build/Cache.zig +2248 27318475 1713603314000000000 95a1bb668e0c39f345c83920bac861b7 1 std/Build/Cache/Directory.zig +35896 27318716 1713603314000000000 fe6ca890c29b51018c25e7269898a5f5 1 std/fs.zig +111536 27318710 1713603314000000000 04f568f3193c7bb5986efc4ec52bfd91 1 std/fs/Dir.zig +77139 27318713 1713603314000000000 6ed68741d6922f90c45c6c388b6cdd8c 1 std/fs/path.zig +63631 27318711 1713603314000000000 8ad62418ac37873a457da68a3e6d1cbd 1 std/fs/File.zig +12563 27318888 1713603314000000000 edca846565ef855c728e7372feed8676 1 std/os/linux/x86_64.zig +114248 27318546 1713603314000000000 7aa5a3d5d7c75f7861328581549e6a5d 1 std/array_hash_map.zig +38005 27318859 1713603314000000000 2df15a06c9368a128b68d617837153ef 1 std/multi_array_list.zig +12352 27318680 1713603314000000000 85ba4034d104ed83a45a1bb6ea2f588a 1 std/crypto.zig +18622 27318674 1713603314000000000 05742583e9b394547e0631c84131938c 1 std/crypto/siphash.zig +90072 27318731 1713603314000000000 bffdf0affa202d9bafbc94cdc1368f10 1 std/hash_map.zig +26882 27318512 1713603314000000000 5b9ff543d20a09f8c07cb235a7f3c28e 1 std/Target/Query.zig +45642 27319001 1713603314000000000 1a3ac893968caf40f15a61a3e4020198 1 std/zig.zig +50411 27318998 1713603314000000000 82486579bb5aad521f09f0d3d65a8cb2 1 std/zig/system.zig +19326 27318493 1713603314000000000 766135bc25af9bff89d8013842b0a3a1 1 std/Build/Step.zig +27082 27318478 1713603314000000000 bdca4aa055041af2bc0ef6b1f83da1e6 1 std/Build/Module.zig +15691 27318492 1713603314000000000 6ec561987815837c4b1fcbb12e9ed5a9 1 std/Build/Step/WriteFile.zig +16345 27318496 1713603314000000000 07047c90cfdb25f62565ada1af0fb2ee 1 std/Progress.zig +13678 27318962 1713603314000000000 acfd077e4b0672dfb9bc1907ad8440ef 1 std/time.zig +29047 27318976 1713603314000000000 5f3981d473c44fc809036b5e536a694f 1 std/zig/ErrorBundle.zig +75832 27318481 1713603314000000000 a5ae9e18da05cc8d84a2f6b583386a1e 1 std/Build/Step/Compile.zig +112733 27318692 1713603314000000000 6a3c4b87759cf30d9e7a65625e6143a3 1 std/dwarf.zig +31602 27318482 1713603314000000000 0b153dee69d22e607a2074625ef81a60 1 std/Build/Step/ConfigHeader.zig +1884 27318843 1713603314000000000 4e39bcecc218a8cefd7304859e028778 1 std/math/log2.zig +4147 27318539 1713603314000000000 c733287dced3af877a263cad44139c4b 1 std/Thread/Pool.zig +8365 27318788 1713603314000000000 1e96c9d448e9ae1d3162881bf730b07e 1 std/log.zig +105663 27318708 1713603314000000000 8d4becc343bcd3adac05a9906326c6df 1 std/fmt.zig +25504 27318771 1713603314000000000 0d380feec771d277d38493250815b334 1 std/io.zig +5237 27318770 1713603314000000000 1ffe030ee2cb56e3f4f0730c76a43a35 1 std/io/tty.zig +80096 27318966 1713603314000000000 dcae88764146b76769ce525b262e7a9a 1 std/unicode.zig +17590 27318509 1713603314000000000 5ddd4d07802b9f332a306c207663eea0 1 std/Random.zig +3177 27318505 1713603314000000000 ece4176296c0d5a4735a0e13195d3e89 1 std/Random/Xoshiro256.zig +23359 27318536 1713603314000000000 55e7c53750c5f84af61f7e61406bc0f0 1 std/Thread/Condition.zig +1796 27318543 1713603314000000000 43f2cf40b5fd32903bf18a54ea66fc91 1 std/Thread/WaitGroup.zig +9239 27318540 1713603314000000000 d703f6a7af8c150d259a587850decd1f 1 std/Thread/ResetEvent.zig +2259 27318753 1713603314000000000 d0332ba9399d02f163b9033b979acb28 1 std/io/Writer.zig +13319 27318927 1713603314000000000 0ecb167cdc15eca0651fa6c248c99804 1 std/os/wasi.zig +6209 27318676 1713603314000000000 89d4ae344badeeee363daef10bc5ad3f 1 std/crypto/tlcsprng.zig +29773 27318952 1713603314000000000 6e96f5117f2db4b1f67515385b4cbc04 1 std/sort.zig +51714 27318950 1713603314000000000 eb8790d984ce4a6ddd6376d877c85ff1 1 std/sort/block.zig +14616 27318548 1713603314000000000 0fed3eb789529104667fd82e81a9af62 1 std/ascii.zig +75370 27318516 1713603314000000000 30731038480465fdb69c8c513ebbbcb7 1 std/Target/arm.zig +9668 27318609 1713603314000000000 50cd66d0ffbb1cf4482a14a8dfa96197 1 std/comptime_string_map.zig +10710 27318951 1713603314000000000 f2973ab2be6115a15cf6c75a2be36ad3 1 std/sort/pdq.zig +7643 27318848 1713603314000000000 03910049e32f401cd3296cc1352aecb4 1 std/math/powi.zig +55565 27318695 1713603314000000000 70d775478d92cce6032146b76e8b8314 1 std/enums.zig +1730 27318730 1713603314000000000 36cb1b0b5e0bb7d10f9b200b0a751743 1 std/hash.zig +19864 27318724 1713603314000000000 e3e11ead12f4f8bc5a4a39618951d77d 1 std/hash/crc.zig +7844 27318722 1713603314000000000 dae49ec27edbdf6d4a70a92a1d8f6614 1 std/hash/crc/impl.zig +6449 27318764 1713603314000000000 3bcfe7862cea857ee79939a098991ad5 1 std/io/fixed_buffer_stream.zig +14434 27318752 1713603314000000000 2655b33c088dd930683d9eb843eaceb4 1 std/io/Reader.zig +2057 27318608 1713603314000000000 a778ec13ef93e0ace847f52f066441fd 1 std/compress.zig +3736 27318600 1713603314000000000 a5c9eee5eaf5943e22c8a03fac3f2841 1 std/compress/zlib.zig +23371 27318585 1713603314000000000 9114b9a4ebd2dc71d31987c5fc13b8ba 1 std/compress/flate/inflate.zig +7460 27318581 1713603314000000000 1c1d1c1c4e61c64090b7ace80a4c2dab 1 std/compress/flate/container.zig +16625 27318577 1713603314000000000 8ba4aa19f03596c0d0eb18045a7331e8 1 std/compress/flate/bit_reader.zig +7434 27318573 1713603314000000000 a6347ffd91bdf7b166947d627e9f38c5 1 std/compress/flate/CircularBuffer.zig +3519 27318718 1713603314000000000 4e3c7d701979e5945ab9f85fed59a579 1 std/hash/adler.zig +10966 27318583 1713603314000000000 e24401bc06abbf873844211e243f0871 1 std/compress/flate/huffman_decoder.zig +1399 27318685 1713603314000000000 40a7d4ac60d12c6e9ca294acaed35474 1 std/dwarf/FORM.zig +3900 27318688 1713603314000000000 b5711d1b73e43c5aaea25647f88f9369 1 std/dwarf/TAG.zig +7395 27318682 1713603314000000000 0736a520f4793791a2cfc257bfcfd3b6 1 std/dwarf/AT.zig +643 27318684 1713603314000000000 6f6a9e4e1602df062ad02179710971c4 1 std/dwarf/EH.zig +87942 27318882 1713603314000000000 2082c17ae271b44b3575bcdb700a983d 1 std/os/linux/syscalls.zig +21032 27318997 1713603314000000000 428db229fc4369a2f36bf0c2fc759942 1 std/zig/system/x86.zig +1273 27318515 1713603314000000000 92589c8e708010b66287cffb30b3644a 1 std/Target/arc.zig +69762 27318517 1713603314000000000 d6af57434a87d01c08b32d2bfe25fdaa 1 std/Target/avr.zig +77144 27318519 1713603314000000000 c690addfa0ddc66f16428c3843909a46 1 std/Target/csky.zig +16084 27318520 1713603314000000000 ca6f1a2a9e6e8fa60a8331d7c5f5ce34 1 std/Target/hexagon.zig +7121 27318522 1713603314000000000 d75880c23fe47c4e74168b752266aab9 1 std/Target/m68k.zig +2220 27318524 1713603314000000000 d6af7e91115ce15de6cc6fa6b85ad607 1 std/Target/msp430.zig +72388 27318514 1713603314000000000 b592b5b1741bb6ca4b4bd7df1b4ee0aa 1 std/Target/amdgpu.zig +25661 27318528 1713603314000000000 6160b24d02ef2886240a2714d944d75f 1 std/Target/s390x.zig +1273 27318534 1713603314000000000 1becbd14309ffd333ba9f93137feeab0 1 std/Target/xtensa.zig +1248 27318531 1713603314000000000 b8612e45820413ede9faa05b84c38ef8 1 std/Target/ve.zig +82799 27318513 1713603314000000000 fdca0833003d54262db364549149528b 1 std/Target/aarch64.zig +2248 27318518 1713603314000000000 3d1e4a68e841dcca2978d00e3152786a 1 std/Target/bpf.zig +4600 27318521 1713603314000000000 e904a450b07c1d22dfac25391c3dcf8e 1 std/Target/loongarch.zig +16066 27318523 1713603314000000000 6e5fb373b9f2ae19c60dbed74eb241dc 1 std/Target/mips.zig +34231 27318526 1713603314000000000 de0fb7249581c631bb7bc95aced67759 1 std/Target/powerpc.zig +44356 27318527 1713603314000000000 e4a208a94d7a59c2053efe94036e5170 1 std/Target/riscv.zig +13359 27318529 1713603314000000000 f3523531a5151972318dd7f02ec8f6c1 1 std/Target/sparc.zig +77930 27318530 1713603314000000000 0611f617b9ec2d1a8e22aa44c1fe7363 1 std/Target/spirv.zig +12520 27318525 1713603314000000000 3085921dd9c1187ee9feccc950c03256 1 std/Target/nvptx.zig +4295 27318532 1713603314000000000 f907cdf8a3f4981470d02f3eb835a744 1 std/Target/wasm.zig +19546 27318689 1713603314000000000 eeb537ce254d8635c5876f3cb23ba2ab 1 std/dwarf/abi.zig +26403 27318690 1713603314000000000 17cfec6893f0195cf3f2128e131aebbd 1 std/dwarf/call_frame.zig +71838 27318691 1713603314000000000 472566d679006f02ce08a8e6d3ca5840 1 std/dwarf/expressions.zig +10091 27318969 1713603314000000000 616a2d791eb8d67329f8198701e2bbad 1 std/valgrind.zig +23315 27318949 1713603314000000000 ffbdbe729df38f396c8bfb00dd14e4d7 1 std/simd.zig +52849 27318490 1713603314000000000 4b550e83c1d4e676002cd0b0a120334c 1 std/Build/Step/Run.zig +62647 27318571 1713603314000000000 d908ba4b7946c7422cfa3fb9ee30e98c 1 std/child_process.zig +530 27318503 1713603314000000000 6862d091fadcbbb652464ab10689bd23 1 std/Random/SplitMix64.zig +43084 27318537 1713603314000000000 a67e9f409c649ae15d47dcc9582247f0 1 std/Thread/Futex.zig +17014 27318693 1713603314000000000 b0e0b21898d4115f9772e9cddc07b2b7 1 std/dynamic_library.zig +17851 27318786 1713603314000000000 62510503fe6b45659189d32c19c9dc45 1 std/leb128.zig +1299 27318758 1713603314000000000 9ea5eaf4f2d36e2273f3ecec7f813b61 1 std/io/buffered_writer.zig +9054 27318484 1713603314000000000 507b73e961492111db47cc52a600ef63 1 std/Build/Step/InstallArtifact.zig +1160 27318762 1713603314000000000 32ae6866d358d400739c8281e2b92d26 1 std/io/counting_writer.zig +8372 27318728 1713603314000000000 d48498b32f349820311bbf338ae1aae5 1 std/hash/wyhash.zig +1618 27318580 1713603314000000000 60e22c8a23680b34b51d27b486811807 1 std/compress/flate/consts.zig +13375 27318576 1713603314000000000 239244362ca7a3d92e32a4518ccda927 1 std/compress/flate/Token.zig +194392 27318939 1713603314000000000 8cd958932971ea92fef9cfcc4c3d5a59 1 std/os/windows.zig +36349 27318672 1713603314000000000 0ebc01e41faf9f2bb9acfa3eff243d51 1 std/crypto/sha2.zig +20392 27318696 1713603314000000000 a41115e4a4263ff02975e97d21f21847 1 std/fifo.zig +1464 27318975 1713603314000000000 262bf5a41c36322233615e07256bc570 1 std/zig/Client.zig +8822 27318980 1713603314000000000 f6bcecb528b04a6efa217ed59a282862 1 std/zig/Server.zig +2591 27318709 1713603314000000000 54cecc0501b004131b133c8ec52688b3 1 std/fs/AtomicFile.zig +23028 27318550 1713603314000000000 5f649adf883cb2acad194b60017a4672 1 std/base64.zig +35399 27318474 1713603314000000000 1ee75307680904b768975512f119007a 1 std/Build/Cache/DepTokenizer.zig +3957 27318886 1713603314000000000 8a6d08b36d5d25b29bdff67ade3e947b 1 std/os/linux/vdso.zig +2685 27318498 1713603314000000000 5244bfd5edd68ad074bfdf866029fa86 1 std/Random/ChaCha.zig +52267 27318633 1713603314000000000 250bf69f713193c74da886706bb53369 1 std/crypto/chacha20.zig +792 28374515 1716085224634631478 2f8332e33e9ab33bd65ca604e8f2d3f1 0 /home/lumenk/.cache/zig/p/1220e4669d29190ac809cd3a7726c20b6b49ea7425b7b89cab16d4dc3172016982bc/build_12.zig +5693 27318687 1713603314000000000 01d731f8d28ba8382ff3c5885d5e0c75 1 std/dwarf/OP.zig +7399 27318679 1713603314000000000 7e3716a3c82a36541c6cf09b56a96da0 1 std/crypto/utils.zig +1539 27318765 1713603314000000000 ca6d9ebe9107eb6ffe4cc4b92611772a 1 std/io/limited_reader.zig +14595 27318719 1713603314000000000 9802848537ec3da81ac651945a298250 1 std/hash/auto_hash.zig +63987 27318570 1713603314000000000 92bca8ee6f4f51d8a0205a3b0896031a 1 std/c.zig +10812 27318564 1713603314000000000 b5d2e09197008802157fd9bda951945e 1 std/c/linux.zig diff --git a/zig-cache/h/timestamp b/zig-cache/h/timestamp new file mode 100644 index 0000000..e69de29 diff --git a/zig-cache/o/11166ff00dc31597028577bfb6af61e3/proxy-print b/zig-cache/o/11166ff00dc31597028577bfb6af61e3/proxy-print new file mode 100755 index 0000000..dbe8c4b Binary files /dev/null and b/zig-cache/o/11166ff00dc31597028577bfb6af61e3/proxy-print differ diff --git a/zig-cache/o/11166ff00dc31597028577bfb6af61e3/proxy-print.o b/zig-cache/o/11166ff00dc31597028577bfb6af61e3/proxy-print.o new file mode 100644 index 0000000..120af84 Binary files /dev/null and b/zig-cache/o/11166ff00dc31597028577bfb6af61e3/proxy-print.o differ diff --git a/zig-cache/o/1a7134dccb84940edec3cafa1c9a7420/libproxy-print.a b/zig-cache/o/1a7134dccb84940edec3cafa1c9a7420/libproxy-print.a new file mode 100644 index 0000000..57cbefd Binary files /dev/null and b/zig-cache/o/1a7134dccb84940edec3cafa1c9a7420/libproxy-print.a differ diff --git a/zig-cache/o/1a7134dccb84940edec3cafa1c9a7420/libproxy-print.a.o b/zig-cache/o/1a7134dccb84940edec3cafa1c9a7420/libproxy-print.a.o new file mode 100644 index 0000000..1bb3306 Binary files /dev/null and b/zig-cache/o/1a7134dccb84940edec3cafa1c9a7420/libproxy-print.a.o differ diff --git a/zig-cache/o/1be0e4c62dbbe6366cfee906986afd94/build b/zig-cache/o/1be0e4c62dbbe6366cfee906986afd94/build new file mode 100755 index 0000000..2a54308 Binary files /dev/null and b/zig-cache/o/1be0e4c62dbbe6366cfee906986afd94/build differ diff --git a/zig-cache/o/1be0e4c62dbbe6366cfee906986afd94/build.o b/zig-cache/o/1be0e4c62dbbe6366cfee906986afd94/build.o new file mode 100644 index 0000000..da1293d Binary files /dev/null and b/zig-cache/o/1be0e4c62dbbe6366cfee906986afd94/build.o differ diff --git a/zig-cache/o/94ff9ce473aa29fd9171e5eaf6ba8bc6/dependencies.zig b/zig-cache/o/94ff9ce473aa29fd9171e5eaf6ba8bc6/dependencies.zig new file mode 100644 index 0000000..19e818c --- /dev/null +++ b/zig-cache/o/94ff9ce473aa29fd9171e5eaf6ba8bc6/dependencies.zig @@ -0,0 +1,12 @@ +pub const packages = struct { + pub const @"1220e4669d29190ac809cd3a7726c20b6b49ea7425b7b89cab16d4dc3172016982bc" = struct { + pub const build_root = "/home/lumenk/.cache/zig/p/1220e4669d29190ac809cd3a7726c20b6b49ea7425b7b89cab16d4dc3172016982bc"; + pub const build_zig = @import("1220e4669d29190ac809cd3a7726c20b6b49ea7425b7b89cab16d4dc3172016982bc"); + pub const deps: []const struct { []const u8, []const u8 } = &.{ + }; + }; +}; + +pub const root_deps: []const struct { []const u8, []const u8 } = &.{ + .{ "zig-msgpack", "1220e4669d29190ac809cd3a7726c20b6b49ea7425b7b89cab16d4dc3172016982bc" }, +}; diff --git a/zig-cache/z/0fe4ee79a5f079bb208b60e7e999830b b/zig-cache/z/0fe4ee79a5f079bb208b60e7e999830b new file mode 100644 index 0000000..c92edd2 Binary files /dev/null and b/zig-cache/z/0fe4ee79a5f079bb208b60e7e999830b differ diff --git a/zig-cache/z/4e65d191af395fcf1408160c51ab4245 b/zig-cache/z/4e65d191af395fcf1408160c51ab4245 new file mode 100644 index 0000000..ac05e5e Binary files /dev/null and b/zig-cache/z/4e65d191af395fcf1408160c51ab4245 differ diff --git a/zig-cache/z/8a7f1237b33cd845498403d3ca9acc6c b/zig-cache/z/8a7f1237b33cd845498403d3ca9acc6c new file mode 100644 index 0000000..24e7165 Binary files /dev/null and b/zig-cache/z/8a7f1237b33cd845498403d3ca9acc6c differ diff --git a/zig-out/bin/proxy-print b/zig-out/bin/proxy-print new file mode 100755 index 0000000..dbe8c4b Binary files /dev/null and b/zig-out/bin/proxy-print differ diff --git a/zig-out/lib/libproxy-print.a b/zig-out/lib/libproxy-print.a new file mode 100644 index 0000000..57cbefd Binary files /dev/null and b/zig-out/lib/libproxy-print.a differ