Allow multiple cgen buffers.

This commit is contained in:
Nigel Tao committed 2017-08-26 16:51:53 +10:00
1 parent f839603198
commit c7fe1fd8c1
4 files changed
+583 -557

No files matched your search

+2 -2
View File
@@ -21,8 +21,8 @@ type template_args_short_read struct {
name string
}
func template_short_read(g *gen, args template_args_short_read) error {
g.printf("short_read_%s:\nif (a_%s.limit.ptr_to_len) {\nstatus = %sSUSPENSION_LIMITED_READ;\n} else if (a_%s.buf->closed) {\nstatus = %sERROR_UNEXPECTED_EOF;\ngoto exit;\n} else {\nstatus = %sSUSPENSION_SHORT_READ;\n}\ngoto suspend;\n",
func template_short_read(b *buffer, args template_args_short_read) error {
b.printf("short_read_%s:\nif (a_%s.limit.ptr_to_len) {\nstatus = %sSUSPENSION_LIMITED_READ;\n} else if (a_%s.buf->closed) {\nstatus = %sERROR_UNEXPECTED_EOF;\ngoto exit;\n} else {\nstatus = %sSUSPENSION_SHORT_READ;\n}\ngoto suspend;\n",
args.name,
args.name,
args.PKGPREFIX,