Rename example/library to example/toy-genlib

This commit is contained in:
Nigel Tao committed 2020-08-05 11:55:51 +10:00
1 parent 50bfab9998
commit cf8884d44c
8 files changed
+24 -24

No files matched your search

+5 -6
View File
@@ -3,9 +3,8 @@ Library](/doc/wuffs-the-library.md). See [Hello `wuffs-c`](/hello-wuffs-c) for
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.
@@ -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 @@ for a C compiler $CC, such as clang or gcc.
// 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"