···11+Creative Commons Legal Code
22+33+CC0 1.0 Universal
44+55+ CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
66+ LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
77+ ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
88+ INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
99+ REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
1010+ PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
1111+ THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
1212+ HEREUNDER.
1313+1414+Statement of Purpose
1515+1616+The laws of most jurisdictions throughout the world automatically confer
1717+exclusive Copyright and Related Rights (defined below) upon the creator
1818+and subsequent owner(s) (each and all, an "owner") of an original work of
1919+authorship and/or a database (each, a "Work").
2020+2121+Certain owners wish to permanently relinquish those rights to a Work for
2222+the purpose of contributing to a commons of creative, cultural and
2323+scientific works ("Commons") that the public can reliably and without fear
2424+of later claims of infringement build upon, modify, incorporate in other
2525+works, reuse and redistribute as freely as possible in any form whatsoever
2626+and for any purposes, including without limitation commercial purposes.
2727+These owners may contribute to the Commons to promote the ideal of a free
2828+culture and the further production of creative, cultural and scientific
2929+works, or to gain reputation or greater distribution for their Work in
3030+part through the use and efforts of others.
3131+3232+For these and/or other purposes and motivations, and without any
3333+expectation of additional consideration or compensation, the person
3434+associating CC0 with a Work (the "Affirmer"), to the extent that he or she
3535+is an owner of Copyright and Related Rights in the Work, voluntarily
3636+elects to apply CC0 to the Work and publicly distribute the Work under its
3737+terms, with knowledge of his or her Copyright and Related Rights in the
3838+Work and the meaning and intended legal effect of CC0 on those rights.
3939+4040+1. Copyright and Related Rights. A Work made available under CC0 may be
4141+protected by copyright and related or neighboring rights ("Copyright and
4242+Related Rights"). Copyright and Related Rights include, but are not
4343+limited to, the following:
4444+4545+ i. the right to reproduce, adapt, distribute, perform, display,
4646+ communicate, and translate a Work;
4747+ ii. moral rights retained by the original author(s) and/or performer(s);
4848+iii. publicity and privacy rights pertaining to a person's image or
4949+ likeness depicted in a Work;
5050+ iv. rights protecting against unfair competition in regards to a Work,
5151+ subject to the limitations in paragraph 4(a), below;
5252+ v. rights protecting the extraction, dissemination, use and reuse of data
5353+ in a Work;
5454+ vi. database rights (such as those arising under Directive 96/9/EC of the
5555+ European Parliament and of the Council of 11 March 1996 on the legal
5656+ protection of databases, and under any national implementation
5757+ thereof, including any amended or successor version of such
5858+ directive); and
5959+vii. other similar, equivalent or corresponding rights throughout the
6060+ world based on applicable law or treaty, and any national
6161+ implementations thereof.
6262+6363+2. Waiver. To the greatest extent permitted by, but not in contravention
6464+of, applicable law, Affirmer hereby overtly, fully, permanently,
6565+irrevocably and unconditionally waives, abandons, and surrenders all of
6666+Affirmer's Copyright and Related Rights and associated claims and causes
6767+of action, whether now known or unknown (including existing as well as
6868+future claims and causes of action), in the Work (i) in all territories
6969+worldwide, (ii) for the maximum duration provided by applicable law or
7070+treaty (including future time extensions), (iii) in any current or future
7171+medium and for any number of copies, and (iv) for any purpose whatsoever,
7272+including without limitation commercial, advertising or promotional
7373+purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
7474+member of the public at large and to the detriment of Affirmer's heirs and
7575+successors, fully intending that such Waiver shall not be subject to
7676+revocation, rescission, cancellation, termination, or any other legal or
7777+equitable action to disrupt the quiet enjoyment of the Work by the public
7878+as contemplated by Affirmer's express Statement of Purpose.
7979+8080+3. Public License Fallback. Should any part of the Waiver for any reason
8181+be judged legally invalid or ineffective under applicable law, then the
8282+Waiver shall be preserved to the maximum extent permitted taking into
8383+account Affirmer's express Statement of Purpose. In addition, to the
8484+extent the Waiver is so judged Affirmer hereby grants to each affected
8585+person a royalty-free, non transferable, non sublicensable, non exclusive,
8686+irrevocable and unconditional license to exercise Affirmer's Copyright and
8787+Related Rights in the Work (i) in all territories worldwide, (ii) for the
8888+maximum duration provided by applicable law or treaty (including future
8989+time extensions), (iii) in any current or future medium and for any number
9090+of copies, and (iv) for any purpose whatsoever, including without
9191+limitation commercial, advertising or promotional purposes (the
9292+"License"). The License shall be deemed effective as of the date CC0 was
9393+applied by Affirmer to the Work. Should any part of the License for any
9494+reason be judged legally invalid or ineffective under applicable law, such
9595+partial invalidity or ineffectiveness shall not invalidate the remainder
9696+of the License, and in such case Affirmer hereby affirms that he or she
9797+will not (i) exercise any of his or her remaining Copyright and Related
9898+Rights in the Work or (ii) assert any associated claims and causes of
9999+action with respect to the Work, in either case contrary to Affirmer's
100100+express Statement of Purpose.
101101+102102+4. Limitations and Disclaimers.
103103+104104+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
105105+ surrendered, licensed or otherwise affected by this document.
106106+ b. Affirmer offers the Work as-is and makes no representations or
107107+ warranties of any kind concerning the Work, express, implied,
108108+ statutory or otherwise, including without limitation warranties of
109109+ title, merchantability, fitness for a particular purpose, non
110110+ infringement, or the absence of latent or other defects, accuracy, or
111111+ the present or absence of errors, whether or not discoverable, all to
112112+ the greatest extent permissible under applicable law.
113113+ c. Affirmer disclaims responsibility for clearing rights of other persons
114114+ that may apply to the Work or any use thereof, including without
115115+ limitation any person's Copyright and Related Rights in the Work.
116116+ Further, Affirmer disclaims responsibility for obtaining any necessary
117117+ consents, permissions or other rights required for any use of the
118118+ Work.
119119+ d. Affirmer understands and acknowledges that Creative Commons is not a
120120+ party to this document and has no duty or obligation with respect to
121121+ this CC0 or use of the Work.
+4
README.md
···11+# ZUT
22+The Zig Uncooked Terminal library.
33+44+Right now it only supplies a `zut.get_key()` for retrieving single key presses.
+70
build.zig
···11+const std = @import("std");
22+33+// Although this function looks imperative, note that its job is to
44+// declaratively construct a build graph that will be executed by an external
55+// runner.
66+pub fn build(b: *std.Build) void {
77+ // Standard target options allows the person running `zig build` to choose
88+ // what target to build for. Here we do not override the defaults, which
99+ // means any target is allowed, and the default is native. Other options
1010+ // for restricting supported target set are available.
1111+ const target = b.standardTargetOptions(.{});
1212+1313+ // Standard optimization options allow the person running `zig build` to select
1414+ // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not
1515+ // set a preferred release mode, allowing the user to decide how to optimize.
1616+ const optimize = b.standardOptimizeOption(.{});
1717+1818+ const exe = b.addExecutable(.{
1919+ .name = "io",
2020+ // In this case the main source file is merely a path, however, in more
2121+ // complicated build scripts, this could be a generated file.
2222+ .root_source_file = .{ .path = "src/main.zig" },
2323+ .target = target,
2424+ .optimize = optimize,
2525+ });
2626+2727+ // This declares intent for the executable to be installed into the
2828+ // standard location when the user invokes the "install" step (the default
2929+ // step when running `zig build`).
3030+ b.installArtifact(exe);
3131+3232+ // This *creates* a Run step in the build graph, to be executed when another
3333+ // step is evaluated that depends on it. The next line below will establish
3434+ // such a dependency.
3535+ const run_cmd = b.addRunArtifact(exe);
3636+3737+ // By making the run step depend on the install step, it will be run from the
3838+ // installation directory rather than directly from within the cache directory.
3939+ // This is not necessary, however, if the application depends on other installed
4040+ // files, this ensures they will be present and in the expected location.
4141+ run_cmd.step.dependOn(b.getInstallStep());
4242+4343+ // This allows the user to pass arguments to the application in the build
4444+ // command itself, like this: `zig build run -- arg1 arg2 etc`
4545+ if (b.args) |args| {
4646+ run_cmd.addArgs(args);
4747+ }
4848+4949+ // This creates a build step. It will be visible in the `zig build --help` menu,
5050+ // and can be selected like this: `zig build run`
5151+ // This will evaluate the `run` step rather than the default, which is "install".
5252+ const run_step = b.step("run", "Run the app");
5353+ run_step.dependOn(&run_cmd.step);
5454+5555+ // Creates a step for unit testing. This only builds the test executable
5656+ // but does not run it.
5757+ const unit_tests = b.addTest(.{
5858+ .root_source_file = .{ .path = "src/main.zig" },
5959+ .target = target,
6060+ .optimize = optimize,
6161+ });
6262+6363+ const run_unit_tests = b.addRunArtifact(unit_tests);
6464+6565+ // Similar to creating the run step earlier, this exposes a `test` step to
6666+ // the `zig build --help` menu, providing a way for the user to request
6767+ // running the unit tests.
6868+ const test_step = b.step("test", "Run unit tests");
6969+ test_step.dependOn(&run_unit_tests.step);
7070+}