Rename example/library to example/toy-genlib
diff --git a/build-all.sh b/build-all.sh
index 3ebe519..4652bd7 100755
--- a/build-all.sh
+++ b/build-all.sh
@@ -23,14 +23,14 @@
# its equivalent), although studying this script can help you learn how the
# pieces fit together.
#
-# For example, this script builds command line tools, such as 'wuffs' and
-# 'wuffs-fmt', that are used when *developing* Wuffs, but aren't necessary if
+# For example, this script builds command line tools, such as `wuffs` and
+# `wuffs-fmt`, that are used when *developing* Wuffs, but aren't necessary if
# all you want to do is *use* Wuffs as a third party library. In the latter
# case, the only files you need are those under the release/ directory.
#
# Instead of running this script, you should be able to run the example
-# programs (except the 'example/library' special case) out of the box, without
-# having to separately configure, build or install a library:
+# programs (except the `example/toy-genlib` special case) out of the box,
+# without having to separately configure, build or install a library:
#
# git clone https://github.com/google/wuffs.git
# cd wuffs
diff --git a/build-example.sh b/build-example.sh
index b7a3a4b..93d9753 100755
--- a/build-example.sh
+++ b/build-example.sh
@@ -43,10 +43,10 @@
# example/imageviewer is unusual in that needs additional libraries.
echo "Building gen/bin/example-$f"
$CC -O3 example/$f/*.c -lxcb -lxcb-image -o gen/bin/example-$f
- elif [ $f = library ]; then
- # example/library is unusual in that it uses separately compiled libraries
- # (built by "wuffs genlib", e.g. by running build-all.sh) instead of
- # directly #include'ing Wuffs' .c files.
+ elif [ $f = "toy-genlib" ]; then
+ # example/toy-genlib is unusual in that it uses separately compiled
+ # libraries (built by "wuffs genlib", e.g. by running build-all.sh) instead
+ # of directly #include'ing Wuffs' .c files.
if [ -e gen/lib/c/$CC-static/libwuffs.a ]; then
echo "Building gen/bin/example-$f"
$CC -O3 -static -I.. example/$f/*.c gen/lib/c/$CC-static/libwuffs.a -o gen/bin/example-$f
diff --git a/doc/changelog.md b/doc/changelog.md
index e8817c3..fed041a 100644
--- a/doc/changelog.md
+++ b/doc/changelog.md
@@ -37,6 +37,7 @@
- Removed `ack_metadata_chunk?`.
- Removed `wuffs_base__frame_config__blend`.
- Renamed `decode_io_writer?` methods to `transform_io?`.
+- Renamed `example/library` to `example/toy-genlib`.
- Renamed `swizzle_interleaved!` to `swizzle_interleaved_from_slice!`.
- Renamed warnings to notes.
diff --git a/doc/note/initialization.md b/doc/note/initialization.md
index b126dde..b93fb79 100644
--- a/doc/note/initialization.md
+++ b/doc/note/initialization.md
@@ -13,8 +13,8 @@
`wuffs_foo__bar` is deliberately an incomplete type. Its size is not part of
the stable ABI. Instead, call the `sizeof__wuffs_foo__bar` *function*, whose
return value can change across Wuffs versions, even across point releases.
- For an example, look for `calloc` in the
- [example/library](/example/library/library.c) program.
+ For an example, look for `sizeof__wuffs_json__decoder` in the
+ [example/jsonptr](/example/jsonptr/jsonptr.cc) program.
- The Wuffs library version, `WUFFS_VERSION`.
- Additional flags.
diff --git a/doc/std/compression-decoders.md b/doc/std/compression-decoders.md
index 8dac8e4..19a0d45 100644
--- a/doc/std/compression-decoders.md
+++ b/doc/std/compression-decoders.md
@@ -30,7 +30,7 @@
## Examples
-- [example/library](/example/library)
+- [example/toy-genlib](/example/toy-genlib)
- [example/zcat](/example/zcat)
diff --git a/doc/wuffs-the-library.md b/doc/wuffs-the-library.md
index 8887f86..4554ab1 100644
--- a/doc/wuffs-the-library.md
+++ b/doc/wuffs-the-library.md
@@ -27,6 +27,6 @@
definition.
Most of the example programs treat it as a `.c` file. The
-[`/example/library`](/example/library) program treats it as a `.h` file, and
-requires a separate step (e.g. running `wuffs genlib` beforehand) to build the
-library implementation (e.g. a `libwuffs.a` or `libwuffs.so` file).
+[`/example/toy-genlib`](/example/toy-genlib) program treats it as a `.h` file,
+and requires a separate step (running `wuffs genlib` beforehand) to build the
+library implementation (a `libwuffs.a` or `libwuffs.so` file).
diff --git a/example/README.md b/example/README.md
index 2988b44..6758b8b 100644
--- a/example/README.md
+++ b/example/README.md
@@ -3,9 +3,8 @@
an example program that uses [Wuffs the Language](/doc/wuffs-the-language.md)
and its `wuffs-c` compiler.
-Other than [example/library](/example/library/library.c), all of these programs
-do real work. They're not just programming language toys at the "calculate the
-Fibonacci sequence" level of triviality. For example, the
-[example/crc32](/example/crc32/crc32.cc) and
-[example/zcat](/example/zcat/zcat.c) programs are roughly equivalent to Debian
-Linux's `/usr/bin/crc32` and `/bin/zcat` programs.
+Other than the `toy-*` examples, all of these programs do real work. They're
+not just programming language toys at the "calculate the Fibonacci sequence"
+level of triviality. For example, the [example/crc32](/example/crc32/crc32.cc)
+and [example/zcat](/example/zcat/zcat.c) programs are roughly equivalent to
+Debian Linux's `/usr/bin/crc32` and `/bin/zcat` programs.
diff --git a/example/library/library.c b/example/toy-genlib/toy-genlib.c
similarity index 91%
rename from example/library/library.c
rename to example/toy-genlib/toy-genlib.c
index d705cdd..0ebebf8 100644
--- a/example/library/library.c
+++ b/example/toy-genlib/toy-genlib.c
@@ -15,17 +15,17 @@
// ----------------
/*
-library exercises the software libraries built by `wuffs genlib`.
+toy-genlib exercises the software libraries built by `wuffs genlib`.
To exercise the static library:
-$CC -static -I../../.. library.c ../../gen/lib/c/$CC-static/libwuffs.a
+$CC -static -I../../.. toy-genlib.c ../../gen/lib/c/$CC-static/libwuffs.a
./a.out
rm -f a.out
To exercise the dynamic library:
-$CC -I../../.. library.c -L../../gen/lib/c/$CC-dynamic -lwuffs
+$CC -I../../.. toy-genlib.c -L../../gen/lib/c/$CC-dynamic -lwuffs
LD_LIBRARY_PATH=../../gen/lib/c/$CC-dynamic ./a.out
rm -f a.out
@@ -40,7 +40,7 @@
// By #include'ing it "as is" without #define'ing WUFFS_IMPLEMENTATION, we use
// it as a "foo.h"-like header, instead of a "foo.c"-like implementation.
#if defined(WUFFS_IMPLEMENTATION)
-#error "example/library should not #define WUFFS_IMPLEMENTATION"
+#error "example/toy-genlib should not #define WUFFS_IMPLEMENTATION"
#endif
#include "wuffs/release/c/wuffs-unsupported-snapshot.c"