pqtest.c (1062B)
1 /* 2 * Copy me if you can. 3 * by 20h 4 * 5 * % make pqtest 6 * % ./pqtest 7 */ 8 9 #include <unistd.h> 10 #include <stdlib.h> 11 #include <stdio.h> 12 #include <string.h> 13 14 #include "quote.h" 15 16 int 17 main(int argc, char *argv[]) 18 { 19 char *test = "This is something, we will see, how it is encoded.\t" 20 "This is a bit longer, to try out the automatic wrapping.\n"; 21 char *test2 = "There we have some รครครค header test."; 22 char *test3 = "Decoding=20 =c3=a4=c3=a4 =\nis fun."; 23 char *test4 = "Header_decodin=09g_=c3=a4=c3=a4_is_fun=20"; 24 char *str; 25 int len; 26 27 printf("before: %s\n", test); 28 str = qpenc(test, strlen(test), 0); 29 printf("str = %s\n", str); 30 free(str); 31 32 printf("before: %s\n", test2); 33 str = qpenc(test2, strlen(test2), 1); 34 printf("str = %s\n", str); 35 free(str); 36 37 len = strlen(test3); 38 printf("before: %s (%d)\n", test3, len); 39 str = qpdec(test3, &len, 0); 40 printf("str = %s (%d)\n", str, len); 41 free(str); 42 43 len = strlen(test4); 44 printf("before: %s (%d)\n", test4, len); 45 str = qpdec(test4, &len, 1); 46 printf("str = %s (%d)\n", str, len); 47 free(str); 48 49 return 0; 50 } 51