shithub: dfc

Download patch

ref: 2e08190b534ac79e33d1813c8d0aa9d71dbd1d02
parent: 63a97c6b07084821d72668861910c122faa3dcfe
author: Jacob Moody <moody@posixcafe.org>
date: Tue Jul 25 18:55:29 EDT 2023

u8int as well and some more man page changes

--- a/dfc.1
+++ b/dfc.1
@@ -47,15 +47,28 @@
 typedef's are parsed but do not have any impact; Any struct defined
 is expected to be typedef'd.
 .PP
-Struct member types must be one of 
+Struct member types must be one of
 .BR u64int ,
 .BR u32int ,
 .BR u16int ,
+.BR u8int ,
 .BR uchar ,
-or may refer to another struct defined previously.
+or a struct previously defined.
+.SH OUTPUT
+For each struct defined
+.I dfc
+outputs two functions. For a struct called
+.L Block
+the following functions are generated:
+.IP
+.EX
+long getblock(Block *dst, uchar *src);
+long putblock(uchar *dst, Block *src);
+.EE
+.PP
+The return value for each is the total number
+of bytes consumed or generated respectively.
 .SH SOURCE
 .B /sys/src/cmd/dfc.y
-.SH SEE ALSO
-.IR yacc (1)
 .SH BUGS
 Calling the input grammer a subset of C is generous.
--- a/dfc.y
+++ b/dfc.y
@@ -502,6 +502,8 @@
 		return TYPEDEF;
 	if(strcmp(buf, "uchar") == 0)
 		return UCHAR;
+	if(strcmp(buf, "u8int") == 0)
+		return UCHAR;
 	if(strcmp(buf, "u16int") == 0)
 		return U16;
 	if(strcmp(buf, "u32int") == 0)