add strbuf.c, strbuf.h and fix a little problems