[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: xstring.h
From: |
Eric Blake |
Subject: |
Re: xstring.h |
Date: |
Fri, 09 May 2008 18:40:23 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080421 Thunderbird/2.0.0.14 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Bruno Haible on 5/9/2008 5:50 PM:
| Going a bit farther than Eric's xmemdup0 function, I would like to propose
| a module 'xstring' with an <xstring.h> header file that defines the
following
| functions:
|
| /* Return a substring of the given string, len bytes long starting at
str. */
| char * xsubstring (const char *str, size_t len);
How is this different from [x]strndup? At least strndup is standardized.
|
| /* Duplicate a string. Moved here from xalloc.h. Keeps being declared in
| xalloc.h for a transition period, with a warning if it's used from
there
| (a migration aid). */
| char * xstrdup (const char *string);
|
|
| Comments? Additions?
The remaining functions looked reasonable from a first glance.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkgk7vcACgkQ84KuGfSFAYC8kQCdGi7HNyJKcP76fW5+wh2jAyLl
rggAoJ8Vhj6RLAmkPeMYTMSx6XTCq2SA
=TSV2
-----END PGP SIGNATURE-----