diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-24 23:22:41 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-07-24 23:22:41 +0000 |
commit | be347f2e6655bfcb050fa8188435799369efab38 (patch) | |
tree | 06391e2bbc357e793b4a7f9749c97012828c5e56 /libiberty/functions.texi | |
parent | 04953c086dbc2ee9a2350d2618094aebd89dea7f (diff) | |
download | gcc-be347f2e6655bfcb050fa8188435799369efab38.tar.gz |
libiberty/:
* crc32.c: New file.
* Makefile.in: Rebuild dependencies.
(CFILES): Add crc32.c.
(REQUIRED_OFILES): Add ./crc32.o.
* functions.texi: Rebuild.
include/:
* libiberty.h (crc32): Declare.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150067 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/functions.texi')
-rw-r--r-- | libiberty/functions.texi | 47 |
1 files changed, 33 insertions, 14 deletions
diff --git a/libiberty/functions.texi b/libiberty/functions.texi index da9a3202235..9598b3c83ed 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 |