diff --git a/test/b64decode.c b/test/b64decode.c new file mode 100644 index 0000000..93677e9 --- /dev/null +++ b/test/b64decode.c @@ -0,0 +1,26 @@ +#include +#include "buffer.h" +#include "textcode.h" + +void b64encode(const char* c) { + char* buf=alloca(strlen(c)*2+4); + unsigned int dlen; + scan_base64(c,buf,&dlen); + buffer_put(buffer_1,buf,dlen); + buffer_putnlflush(buffer_1); +} + +main(int argc,char* argv[]) { + int i; + for (i=1; i +#include "buffer.h" +#include "textcode.h" + +void b64encode(const char* c) { + char* buf=alloca(strlen(c)*2+4); + buffer_put(buffer_1,buf,fmt_base64(buf,c,strlen(c))); + buffer_putnlflush(buffer_1); +} + +main(int argc,char* argv[]) { + int i; + for (i=1; i + +int main() { + char buf[4096]; + __write1("both aligned\n"); + byte_copy(buf,16,"this is a test!\n"); + __write1("destination aligned, source unaligned\n"); + byte_copy(buf,1000,buf+1); + __write1("destination unaligned, source aligned\n"); + byte_copy(buf+1,1000,buf); + __write1("both unaligned\n"); + byte_copy(buf+1,1000,buf+3); +} diff --git a/test/urlencode.c b/test/urlencode.c index 51df16e..e2dfa0f 100644 --- a/test/urlencode.c +++ b/test/urlencode.c @@ -13,5 +13,12 @@ main(int argc,char* argv[]) { for (i=1; i