From: Bruno Haible Date: Tue, 14 Jan 2003 13:19:16 +0000 (+0000) Subject: Comments. X-Git-Tag: v0.12~1178 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a6a18886454bb1ae555c027ba991593601823ba;p=thirdparty%2Fgettext.git Comments. --- diff --git a/lib/fstrcmp.h b/lib/fstrcmp.h index fa3f1bbe5..9f55c33e4 100644 --- a/lib/fstrcmp.h +++ b/lib/fstrcmp.h @@ -1,5 +1,5 @@ -/* GNU gettext - internationalization aids - Copyright (C) 1995, 2000, 2002 Free Software Foundation, Inc. +/* Fuzzy string comparison. + Copyright (C) 1995, 2000, 2002-2003 Free Software Foundation, Inc. This file was written by Peter Miller @@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef _FSTRCMP_H #define _FSTRCMP_H -extern double fstrcmp (const char *__s1, const char *__s2); +/* Fuzzy compare of S1 and S2. Return a measure for the similarity of S1 + and S1. The higher the result, the more similar the strings are. */ +extern double fstrcmp (const char *s1, const char *s2); #endif diff --git a/lib/minmax.h b/lib/minmax.h index b26174dc2..376fc1348 100644 --- a/lib/minmax.h +++ b/lib/minmax.h @@ -1,5 +1,5 @@ /* MIN, MAX macros. - Copyright (C) 1995, 1998, 2001 Free Software Foundation, Inc. + Copyright (C) 1995, 1998, 2001, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,6 +22,7 @@ since otherwise we get redefinitions on some systems. */ #include +/* MAX(a,b) returns the maximum of A and B. */ #ifndef MAX # if __STDC__ && defined __GNUC__ && __GNUC__ >= 2 # define MAX(a,b) (__extension__ \ @@ -34,6 +35,7 @@ # endif #endif +/* MIN(a,b) returns the minimum of A and B. */ #ifndef MIN # if __STDC__ && defined __GNUC__ && __GNUC__ >= 2 # define MIN(a,b) (__extension__ \ diff --git a/lib/stpcpy.h b/lib/stpcpy.h index 6583189ff..b579c5c9d 100644 --- a/lib/stpcpy.h +++ b/lib/stpcpy.h @@ -1,5 +1,5 @@ /* String copying. - Copyright (C) 1995, 2001-2002 Free Software Foundation, Inc. + Copyright (C) 1995, 2001, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -25,7 +25,8 @@ #else -extern char *stpcpy (char *__dst, const char *__src); +/* Copy SRC to DST, returning the address of the terminating '\0' in DST. */ +extern char *stpcpy (char *dst, const char *src); #endif diff --git a/lib/stpncpy.h b/lib/stpncpy.h index af239dc55..ad3586173 100644 --- a/lib/stpncpy.h +++ b/lib/stpncpy.h @@ -1,5 +1,5 @@ /* String copying. - Copyright (C) 1995, 2001-2002 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -22,9 +22,11 @@ #ifndef __GNU_LIBRARY__ +/* Copy no more than N characters of SRC to DST, returning the address of + the last character written into DST. */ /* When not using the GNU libc we use the stpncpy implementation we provide here. */ -extern char *gnu_stpncpy (char *__dst, const char *__src, size_t __n); +extern char *gnu_stpncpy (char *dst, const char *src, size_t n); #define stpncpy(Dst, Src, N) gnu_stpncpy (Dst, Src, N) #endif diff --git a/lib/strcase.h b/lib/strcase.h index f590e8d21..f17e64832 100644 --- a/lib/strcase.h +++ b/lib/strcase.h @@ -1,5 +1,5 @@ /* Case-insensitive string comparison functions. - Copyright (C) 1995-1996, 2001-2002 Free Software Foundation, Inc. + Copyright (C) 1995-1996, 2001, 2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -20,7 +20,16 @@ #include -extern int strcasecmp (const char *__s1, const char *__s2); -extern int strncasecmp (const char *__s1, const char *__s2, size_t __n); +/* Compare strings S1 and S2, ignoring case, returning less than, equal to or + greater than zero if S1 is lexicographically less than, equal to or greater + than S2. + Note: This function does not work correctly in multibyte locales. */ +extern int strcasecmp (const char *s1, const char *s2); + +/* Compare no more than N characters of strings S1 and S2, ignoring case, + returning less than, equal to or greater than zero if S1 is + lexicographically less than, equal to or greater than S2. + Note: This function can not work correctly in multibyte locales. */ +extern int strncasecmp (const char *s1, const char *s2, size_t n); #endif /* _STRCASE_H */ diff --git a/lib/vasprintf.h b/lib/vasprintf.h index cd4a8aa82..b71798d08 100644 --- a/lib/vasprintf.h +++ b/lib/vasprintf.h @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,6 +45,10 @@ extern "C" { #endif +/* Write formatted output to a string dynamically allocated with malloc(). + If the memory allocation succeeds, store the address of the string in + *RESULT and return the number of resulting bytes, excluding the trailing + NUL. Upon memory allocation error, or some other error, return -1. */ extern int asprintf (char **result, const char *format, ...) __attribute__ ((__format__ (__printf__, 2, 3))); extern int vasprintf (char **result, const char *format, va_list args) diff --git a/libasprintf/vasnprintf.h b/libasprintf/vasnprintf.h index 6822ae9ac..65f1bc13d 100644 --- a/libasprintf/vasnprintf.h +++ b/libasprintf/vasnprintf.h @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002-2003 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published @@ -42,6 +42,13 @@ extern "C" { #endif +/* Write formatted output to a string dynamically allocated with malloc(). + You can pass a preallocated buffer for the result in RESULTBUF and its + size in *LENGTHP; otherwise you pass RESULTBUF = NULL. + If successful, return the address of the string (this may be = RESULTBUF + if no dynamic memory allocation was necessary) and set *LENGTHP to the + number of resulting bytes, excluding the trailing NUL. Upon error, set + errno and return NULL. */ extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)