rename putc to putchar to avoid name conflict with macro