541 |
|
|
542 |
scm_putc ('"', port); |
scm_putc ('"', port); |
543 |
for (i = 0; i < SCM_STRING_LENGTH (exp); ++i) |
for (i = 0; i < SCM_STRING_LENGTH (exp); ++i) |
544 |
switch (SCM_STRING_CHARS (exp)[i]) |
{ |
545 |
{ |
unsigned char ch = SCM_STRING_CHARS (exp)[i]; |
546 |
case '"': |
if ((ch < 32 && ch != '\n') || (127 <= ch && ch < 148)) |
547 |
case '\\': |
{ |
548 |
scm_putc ('\\', port); |
static char const hex[]="0123456789abcdef"; |
549 |
default: |
scm_putc ('\\', port); |
550 |
scm_putc (SCM_STRING_CHARS (exp)[i], port); |
scm_putc ('x', port); |
551 |
} |
scm_putc (hex [ch / 16], port); |
552 |
|
scm_putc (hex [ch % 16], port); |
553 |
|
} |
554 |
|
else |
555 |
|
{ |
556 |
|
if (ch == '"' || ch == '\\') |
557 |
|
scm_putc ('\\', port); |
558 |
|
scm_putc (ch, port); |
559 |
|
} |
560 |
|
} |
561 |
scm_putc ('"', port); |
scm_putc ('"', port); |
|
break; |
|
562 |
} |
} |
563 |
else |
else |
564 |
scm_lfwrite (SCM_STRING_CHARS (exp), SCM_STRING_LENGTH (exp), port); |
scm_lfwrite (SCM_STRING_CHARS (exp), SCM_STRING_LENGTH (exp), |
565 |
|
port); |
566 |
break; |
break; |
567 |
case scm_tc7_symbol: |
case scm_tc7_symbol: |
568 |
if (SCM_SYMBOL_INTERNED_P (exp)) |
if (SCM_SYMBOL_INTERNED_P (exp)) |