Add documentation about when and why wuffs_base__status might not be ok
@@ -13,9 +13,9 @@ uint32_t parse(char* p, size_t n) {
// wuffs_demo__parser *parser = wuffs_demo__parser__alloc();
// and don't run __initialize();
wuffs_demo__parser parser;
-
status = wuffs_demo__parser__initialize(&parser, sizeof__wuffs_demo__parser(),
WUFFS_VERSION, 0);
+ // This happens when bad arguments are passed to __initialize()
if (!wuffs_base__status__is_ok(&status)) {
printf("initialize: %s\n", wuffs_base__status__message(&status));
return 0;
@@ -29,6 +29,7 @@ uint32_t parse(char* p, size_t n) {
iobuf.meta.pos = 0;
iobuf.meta.closed = true;
+ // This happens when wuffs code returns "# Some status"
status = wuffs_demo__parser__parse(&parser, &iobuf);
if (!wuffs_base__status__is_ok(&status)) {
printf("parse: %s\n", wuffs_base__status__message(&status));
