aboutsummaryrefslogtreecommitdiff
path: root/libiberty/functions.texi
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2009-07-25 00:01:58 +0000
committerDJ Delorie <dj@redhat.com>2009-07-25 00:01:58 +0000
commit6e88169156860fb7a726b875af919cade2c940b5 (patch)
treeda41f9a0dd6db24ac361b0e52a9e4c9172ef8487 /libiberty/functions.texi
parenta331e0d9dbedcbce09b17632159674f0e8c09113 (diff)
downloadfsf-binutils-gdb-6e88169156860fb7a726b875af919cade2c940b5.zip
fsf-binutils-gdb-6e88169156860fb7a726b875af919cade2c940b5.tar.gz
fsf-binutils-gdb-6e88169156860fb7a726b875af919cade2c940b5.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/functions.texi')
-rw-r--r--libiberty/functions.texi47
1 files changed, 33 insertions, 14 deletions
diff --git a/libiberty/functions.texi b/libiberty/functions.texi
index da9a320..9598b3c 100644
--- a/libiberty/functions.texi
+++ b/libiberty/functions.texi
@@ -185,6 +185,21 @@ pointer encountered. Pointers to empty strings are ignored.
@end deftypefn
+@c crc32.c:141
+@deftypefn Extension unsigned int crc32 (const unsigned char *@var{buf}, int @var{len}, unsigned int @var{init})
+
+Compute the 32-bit CRC of @var{buf} which has length @var{len}. The
+starting value is @var{init}; this may be used to compute the CRC of
+data split across multiple buffers by passing the return value of each
+call as the @var{init} parameter of the next.
+
+This is intended to match the CRC used by the @command{gdb} remote
+protocol for the @samp{qCRC} command. In order to get the same
+results as gdb for a block of data, you must pass the first CRC
+parameter as @code{0xffffffff}.
+
+@end deftypefn
+
@c argv.c:52
@deftypefn Extension char** dupargv (char **@var{vector})
@@ -1111,13 +1126,15 @@ be the value @code{1}).
@c snprintf.c:28
@deftypefn Supplemental int snprintf (char *@var{buf}, size_t @var{n}, const char *@var{format}, ...)
-This function is similar to sprintf, but it will print at most @var{n}
-characters. On error the return value is -1, otherwise it returns the
-number of characters that would have been printed had @var{n} been
-sufficiently large, regardless of the actual value of @var{n}. Note
-some pre-C99 system libraries do not implement this correctly so users
-cannot generally rely on the return value if the system version of
-this function is used.
+This function is similar to @code{sprintf}, but it will write to
+@var{buf} at most @code{@var{n}-1} bytes of text, followed by a
+terminating null byte, for a total of @var{n} bytes.
+On error the return value is -1, otherwise it returns the number of
+bytes, not including the terminating null byte, that would have been
+written had @var{n} been sufficiently large, regardless of the actual
+value of @var{n}. Note some pre-C99 system libraries do not implement
+this correctly so users cannot generally rely on the return value if
+the system version of this function is used.
@end deftypefn
@@ -1464,13 +1481,15 @@ nonstandard but common function @code{_doprnt}.
@c vsnprintf.c:28
@deftypefn Supplemental int vsnprintf (char *@var{buf}, size_t @var{n}, const char *@var{format}, va_list @var{ap})
-This function is similar to vsprintf, but it will print at most
-@var{n} characters. On error the return value is -1, otherwise it
-returns the number of characters that would have been printed had
-@var{n} been sufficiently large, regardless of the actual value of
-@var{n}. Note some pre-C99 system libraries do not implement this
-correctly so users cannot generally rely on the return value if the
-system version of this function is used.
+This function is similar to @code{vsprintf}, but it will write to
+@var{buf} at most @code{@var{n}-1} bytes of text, followed by a
+terminating null byte, for a total of @var{n} bytes. On error the
+return value is -1, otherwise it returns the number of characters that
+would have been printed had @var{n} been sufficiently large,
+regardless of the actual value of @var{n}. Note some pre-C99 system
+libraries do not implement this correctly so users cannot generally
+rely on the return value if the system version of this function is
+used.
@end deftypefn