Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
870 B

  1. .TH fmt_netstring 3
  2. .SH NAME
  3. fmt_netstring \- convert a memory buffer into a netstring
  4. .SH SYNTAX
  5. .B #include <libowfat/fmt.h>
  6. size_t \fBfmt_netstring\fP(char *\fIdest\fR,const char *\fIsource\fR,
  7. size_t \fIlen\fR);
  8. .SH DESCRIPTION
  9. fmt_netstring creates a netstring from a raw memory buffer and returns
  10. the length.
  11. fmt_netstring does not append \\0.
  12. If \fIdest\fR equals FMT_LEN (i.e. is zero), fmt_netstring returns the number
  13. of bytes it would have written.
  14. .SH "RETURN VALUE"
  15. fmt_netstring returns the number of bytes written (or that would have
  16. been written, had the destination pointer not pointed to NULL).
  17. If the input buffer is implausibly large, fmt_netstring returns 0
  18. instead.
  19. .SH EXAMPLE
  20. The raw memory buffer "foo" would become the netstring "3:foo,"
  21. .SH SPEC
  22. http://cr.yp.to/proto/netstrings.txt
  23. .SH "SEE ALSO"
  24. scan_netstring(3)