From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bruce Korb Newsgroups: gmane.lisp.guile.devel Subject: SCM_STRING_CHARS is deprecated. See the manual for alternatives. Date: Sat, 16 Sep 2006 14:46:53 -0700 Organization: FSF Message-ID: <450C70CD.3020202@gnu.org> Reply-To: bkorb@gnu.org NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1158443235 6721 80.91.229.2 (16 Sep 2006 21:47:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 16 Sep 2006 21:47:15 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Sep 16 23:47:12 2006 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GOi05-0000J7-5t for guile-devel@m.gmane.org; Sat, 16 Sep 2006 23:47:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GOi04-0000Ky-Og for guile-devel@m.gmane.org; Sat, 16 Sep 2006 17:47:00 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GOi00-0000Hh-6Y for guile-devel@gnu.org; Sat, 16 Sep 2006 17:46:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GOhzz-0000Fh-Gp for guile-devel@gnu.org; Sat, 16 Sep 2006 17:46:55 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GOhzz-0000FV-Bc for guile-devel@gnu.org; Sat, 16 Sep 2006 17:46:55 -0400 Original-Received: from [207.115.20.70] (helo=flpi101.sbcis.sbc.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GOi2S-00087g-FD for guile-devel@gnu.org; Sat, 16 Sep 2006 17:49:28 -0400 X-ORBL: [75.0.187.122] Original-Received: from [192.168.0.2] (adsl-75-0-187-122.dsl.pltn13.sbcglobal.net [75.0.187.122]) by flpi101.sbcis.sbc.com (8.13.7 out spool5000 dk/8.13.7) with ESMTP id k8GLkVkj017040 for ; Sat, 16 Sep 2006 14:46:32 -0700 User-Agent: Mozilla Thunderbird 1.0.7 (X11/20050923) X-Accept-Language: en-us, en Original-To: guile-devel@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:6096 Archived-At: Hi, I've seen the manual. For Guile 1.8 it says: > -- Macro: char * SCM_STRING_CHARS (SCM X) > -- Macro: char * SCM_SYMBOL_CHARS (SCM X) > Return a pointer to the characters of X. The result is undefined > if X is not a symbol or string, respectively. > > There are also a few magic values stuffed into memory before a > symbol's characters, but you don't want to know about those. What > cruft! > > Note that `SCM_VECTOR_BASE', `SCM_STRING_CHARS' and > `SCM_SYMBOL_CHARS' return pointers to data within the respective > object. Care must be taken that the object is not garbage collected > while that data is still being accessed. This is the same as for a > smob, *Note Remembering During Operations::. Here's the deal: I just want access to the array of characters. I've never presumed the characters are NUL terminated. Now, I am getting this message and the code itself says: > static SCM > make_stringbuf (size_t len) > { > /* XXX - for the benefit of SCM_STRING_CHARS, SCM_SYMBOL_CHARS and > scm_i_symbol_chars, all stringbufs are null-terminated. Once > SCM_STRING_CHARS and SCM_SYMBOL_CHARS are removed and the code > has been changed for scm_i_symbol_chars, this null-termination > can be dropped. > */ Unfortunately, it seems to take a lot of grubbing around in the source code to find out how to do this. I am completely aware of the fact that any call to any Guile function can invalidate an address gotten via this mechanism. However, with a single threaded program and without making such a call, I know the address will remain valid. I want it. It saves a lot of allocate, copy & free bother. Thank you! Regards, bruce _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel