@@ -3,6 +3,22 @@
3#include <stdlib.h>
3#include <stdlib.h>
4#include <string.h>
4#include <string.h>
6+void lazytext(const char *name)
8+ UFILE *ufp = u_fopen(name, "r", NULL, "UTF-8");
9+ const size_t bufsize = sizeof(UChar) * 32 * 1024;
10+ UChar *str = malloc(bufsize);
15+ n = u_file_read(str, bufsize, ufp);
19+ printf("%ld\n", len);
6void text(const char *name)
22void text(const char *name)
8 UFILE *ufp = u_fopen(name, "r", NULL, "UTF-8");
24 UFILE *ufp = u_fopen(name, "r", NULL, "UTF-8");
@@ -29,7 +45,9 @@ int main(int argc, char **argv)
32− if (strcmp(argv[1], "text") == 0)
48+ if (strcmp(argv[1], "lazytext") == 0)
50+ else if (strcmp(argv[1], "text") == 0)
33 text(argv[2]);
51 text(argv[2]);
35 fprintf(stderr, "no matching handler\n");
53 fprintf(stderr, "no matching handler\n");