[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strings in GMP need nil-termination
From: |
Kevin Ryde |
Subject: |
Re: strings in GMP need nil-termination |
Date: |
Thu, 14 Feb 2002 10:32:21 +1000 |
User-agent: |
Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.1 (i386-debian-linux-gnu) |
Matt Carter <address@hidden> writes:
>
> It would be nice if GMP functions which take strings (e.g. mpf_set_str())
> did not require nil-terminated strings.
Yes. There's an entry in doc/tasks.html for that (about mpz_set_str,
which is where I'd first felt the need).
> Applications that do this cannot use the GMP functions which take
> nil-terminated strings unless they make copies of the strings before passing
> them in (which is costly).
And tedious.
> The problem could be solved if the GMP functions which take nil-terminated
> strings had sister functions which took non-nil-terminated strings
mpz_set_mem or something maybe.
> (they'd
> take an extra "int length" or "char *end" parameter).
A size_t length might be good.