diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml index a6d2a13..b19801d 100644 --- a/doc/src/sgml/xfunc.sgml +++ b/doc/src/sgml/xfunc.sgml @@ -1733,9 +1733,11 @@ typedef struct Finally, all variable-length types must also be passed by reference. All variable-length types must begin - with a length field of exactly 4 bytes, and all data to + with an opaque length field of exactly 4 bytes, which will be set + by SET_VARSIZE; never set this field directly! All data to be stored within that type must be located in the memory - immediately following that length field. The + immediately following the length field, which is customarily + named vl_len_. The length field contains the total length of the structure, that is, it includes the size of the length field itself. @@ -1766,7 +1768,7 @@ typedef struct typedef struct { - int4 length; + int32 vl_len_; char data[1]; } text; @@ -1799,10 +1801,10 @@ memcpy(destination->data, buffer, 40); ]]> - VARHDRSZ is the same as sizeof(int4), but + VARHDRSZ is the same as sizeof(int32), but it's considered good style to use the macro VARHDRSZ to refer to the size of the overhead for a variable-length type. - Also, the length field must be set using the + Also, the vl_len_ field must be set using the SET_VARSIZE macro, not by simple assignment.