From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Clinton Ebadi Newsgroups: gmane.lisp.guile.devel Subject: Re: scm_i_* in Snd Date: Sun, 01 Jun 2008 17:17:33 -0400 Message-ID: <87fxrw4zyq.fsf@unknownlamer.org> References: <87mym450zh.fsf@unknownlamer.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1212355087 13209 80.91.229.12 (1 Jun 2008 21:18:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 1 Jun 2008 21:18:07 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Jun 01 23:18:47 2008 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K2uwx-0001t9-8i for guile-devel@m.gmane.org; Sun, 01 Jun 2008 23:18:47 +0200 Original-Received: from localhost ([127.0.0.1]:56628 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2uwA-0003BY-VR for guile-devel@m.gmane.org; Sun, 01 Jun 2008 17:17:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K2uw4-000380-In for guile-devel@gnu.org; Sun, 01 Jun 2008 17:17:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K2uw2-00034P-S8 for guile-devel@gnu.org; Sun, 01 Jun 2008 17:17:52 -0400 Original-Received: from [199.232.76.173] (port=41341 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K2uw2-000341-Lh for guile-devel@gnu.org; Sun, 01 Jun 2008 17:17:50 -0400 Original-Received: from deleuze.hcoop.net ([69.90.123.67]:54654) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K2uw2-0003tD-E1 for guile-devel@gnu.org; Sun, 01 Jun 2008 17:17:50 -0400 Original-Received: from [71.65.238.103] (helo=localhost.localdomain) by deleuze.hcoop.net with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1K2uw1-0007z0-Jm for guile-devel@gnu.org; Sun, 01 Jun 2008 17:17:49 -0400 In-Reply-To: <87mym450zh.fsf@unknownlamer.org> (Clinton Ebadi's message of "Sun\, 01 Jun 2008 16\:55\:30 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 1) 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:7297 Archived-At: Clinton Ebadi writes: >> Is this okay, and in case not, is there a better way to convert a >> char* into a guile string? > > SCM_API SCM scm_from_locale_string (const char *str); > SCM_API SCM scm_from_locale_stringn (const char *str, size_t len); > SCM_API SCM scm_take_locale_string (char *str); > SCM_API SCM scm_take_locale_stringn (char *str, size_t len); Err, the other way around SCM_API char *scm_to_locale_string (SCM str); SCM_API char *scm_to_locale_stringn (SCM str, size_t *lenp); SCM_API size_t scm_to_locale_stringbuf (SCM str, char *buf, size_t max_len); Granted they all return a fresh string (or store a copy into a preallocated buffer), but this allows the internal Guile string representation to be fancier than a byte array if needed by hiding the internal representation. This will be important when Guile supports things like Unicode (e.g. like SBCL does by using UCS-32 internally and converting into an external encoding such as UTF-8 when needed so as to preserve O(1) string operations and still work with the outside world). -- How can you accept social supression This weak state of mind in our time I demand release from hypocrisy I'd rather die than be held down, forced down