X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Frune%2F_info;h=2b2e2e8b98e8cbb686c20520e22090813c5a5f67;hb=HEAD;hp=e3601560b94f08a6b85d6db00bde9206dd5fa5c0;hpb=8275faaf2fa6989829c976a54da120def4cfeda8;p=ccan diff --git a/ccan/rune/_info b/ccan/rune/_info index e3601560..2b2e2e8b 100644 --- a/ccan/rune/_info +++ b/ccan/rune/_info @@ -40,16 +40,14 @@ * // t= means current time, in seconds, as integer * if (streq(alt->fieldname, "t")) { * struct timeval now; - * s64 t; * gettimeofday(&now, NULL); - * t = now.tv_sec; - * return rune_alt_single(ctx, alt, NULL, &t); + * return rune_alt_single_int(ctx, alt, now.tv_sec); * } * if (streq(alt->fieldname, "uid")) { - * return rune_alt_single(ctx, alt, uid, NULL); + * return rune_alt_single_str(ctx, alt, uid, strlen(uid)); * } * // Otherwise, field is missing - * return rune_alt_single(ctx, alt, NULL, NULL); + * return rune_alt_single_missing(ctx, alt); * } * * int main(int argc, char *argv[]) @@ -73,7 +71,7 @@ * rune = rune_from_base64(NULL, argv[2]); * if (!rune) * errx(1, "Bad rune"); - * restr = rune_restr_from_string(NULL, argv[3]); + * restr = rune_restr_from_string(NULL, argv[3], strlen(argv[3])); * if (!restr) * errx(1, "Bad restriction string"); * rune_add_restr(rune, restr); @@ -115,6 +113,7 @@ int main(int argc, char *argv[]) printf("ccan/base64\n"); printf("ccan/crypto/sha256\n"); printf("ccan/endian\n"); + printf("ccan/mem\n"); printf("ccan/short_types\n"); printf("ccan/str/hex\n"); printf("ccan/tal/str\n");