Sets the contents of dest to be a copy of the contents of src. Returns 0 if the function succeeded, or -1 if there was insufficient memory.
Sets the contents of astr to be a copy of the characters referenced by chars. Returns 0 if the function succeeded, or -1 if there was insufficient memory.
Sets the contents of astr to be c (converted to a ‘char’). c may not be zero. Returns 0 if the function succeeded, or -1 if there was insufficient memory.
Sets the contents of astr to be a copy of the textual portions of the data in ab. Every byte in ab is copied except for null bytes. Returns 0 if the function succeeded, or -1 if there was insufficient memory.
Note that this function has a different naming convention from that of the other ‘astr_copy...’ functions. This is because a conversion from autobuf to autostr to autobuf is lossy.