inttostr: add a new function, inttostr, and tests
[pspp] / lib / memxfrm.h
index 6354633186ab43d3c622788ce386972f1d2f2afb..8b7284a65daa0505830568c0f939c022069a1f81 100644 (file)
@@ -1,5 +1,5 @@
 /* Locale dependent memory area transformation for comparison.
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU Lesser General Public License as published
@@ -33,10 +33,12 @@ extern "C" {
    restored before this function returns.
    The result of this function depends on the LC_COLLATE category of the
    current locale.
-   If successful, return the freshly allocated transformed string and set
-   *LENGTHP to its length,
+   If successful: If resultbuf is not NULL and the result fits into *lengthp
+   bytes, it is put in resultbuf, and resultbuf is returned.  Otherwise, a
+   freshly allocated string is returned.  In both cases, *lengthp is set to the
+   length of the returned string.
    Upon failure, return NULL, with errno set.  */
-extern char * memxfrm (char *s, size_t n, size_t *lengthp);
+extern char * memxfrm (char *s, size_t n, char *resultbuf, size_t *lengthp);
 
 
 #ifdef __cplusplus