unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* scm_from_zbyte_string
@ 2012-11-17  0:53 Bruce Korb
  2012-11-17  4:30 ` scm_from_zbyte_string Mark H Weaver
  0 siblings, 1 reply; 2+ messages in thread
From: Bruce Korb @ 2012-11-17  0:53 UTC (permalink / raw)
  To: guile-devel Development


This is insufficient.  There are the "to" functions
and the string extraction thingys that must be done.
But I really don't like that "scm_i_make_string()" call.

SCM
scm_from_zbyte_string (const char *str)
{
  return scm_from_zbyte_stringn (str, -1);
}

SCM
scm_from_zbyte_stringn (const char *str, size_t len)
{
  char *bf;
  SCM res;

  if (len == (size_t)-1)
    len = strlen (str);
  res = scm_i_make_string (len, &bf, 0);
  memcpy (bf, str, len);
  return res;
}



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: scm_from_zbyte_string
  2012-11-17  0:53 scm_from_zbyte_string Bruce Korb
@ 2012-11-17  4:30 ` Mark H Weaver
  0 siblings, 0 replies; 2+ messages in thread
From: Mark H Weaver @ 2012-11-17  4:30 UTC (permalink / raw)
  To: Bruce Korb; +Cc: guile-devel Development

Bruce Korb <bruce.korb@gmail.com> writes:
> This is insufficient.  There are the "to" functions
> and the string extraction thingys that must be done.
> But I really don't like that "scm_i_make_string()" call.

Use 'scm_from_latin1_string' and 'scm_to_latin1_string', in combination
with setting all the port encodings to "ISO-8859-1" (as described in my
other email), if you want to stick your fingers in your ears and ignore
multilingual issues.

     Mark



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-17  4:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-17  0:53 scm_from_zbyte_string Bruce Korb
2012-11-17  4:30 ` scm_from_zbyte_string Mark H Weaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).