add iob_free and man page for iob_reset.

check in some windoze compat crap (still does not compile through for
windoze)
This commit is contained in:
leitner
2005-03-08 14:56:36 +00:00
parent e73c3e85f1
commit 9eb09b5bfe
21 changed files with 184 additions and 14 deletions

View File

@@ -4,9 +4,9 @@
#include "textcode.h"
#include "havealloca.h"
void b64encode(const char* c) {
char* buf=alloca(strlen(c)*2+4);
buffer_put(buffer_1,buf,fmt_base64(buf,c,strlen(c)));
void b64encode(const char* c,long len) {
char* buf=alloca(len*2+4);
buffer_put(buffer_1,buf,fmt_base64(buf,c,len));
if (isatty(1))
buffer_putnlflush(buffer_1);
else
@@ -16,15 +16,14 @@ void b64encode(const char* c) {
int main(int argc,char* argv[]) {
int i;
for (i=1; i<argc; ++i) {
b64encode(argv[i]);
b64encode(argv[i],strlen(argv[i]));
}
if (argc<2) {
char src[1024];
int len;
while ((len=read(0,src,sizeof(src)-1))>0) {
if (len==-1) return(1);
src[len]=0;
b64encode(src);
b64encode(src,len);
}
}
return 0;