… | |
… | |
1481 | |
1481 | |
1482 | /* make constant */ |
1482 | /* make constant */ |
1483 | static pointer |
1483 | static pointer |
1484 | mk_sharp_const (SCHEME_P_ char *name) |
1484 | mk_sharp_const (SCHEME_P_ char *name) |
1485 | { |
1485 | { |
1486 | long x; |
|
|
1487 | char tmp[STRBUFFSIZE]; |
|
|
1488 | |
|
|
1489 | if (!strcmp (name, "t")) |
1486 | if (!strcmp (name, "t")) |
1490 | return S_T; |
1487 | return S_T; |
1491 | else if (!strcmp (name, "f")) |
1488 | else if (!strcmp (name, "f")) |
1492 | return S_F; |
1489 | return S_F; |
1493 | else if (*name == '\\') /* #\w (character) */ |
1490 | else if (*name == '\\') /* #\w (character) */ |
1494 | { |
1491 | { |
1495 | int c = 0; |
1492 | int c; |
1496 | |
1493 | |
1497 | if (stricmp (name + 1, "space") == 0) |
1494 | if (stricmp (name + 1, "space") == 0) |
1498 | c = ' '; |
1495 | c = ' '; |
1499 | else if (stricmp (name + 1, "newline") == 0) |
1496 | else if (stricmp (name + 1, "newline") == 0) |
1500 | c = '\n'; |
1497 | c = '\n'; |
… | |
… | |
1502 | c = '\r'; |
1499 | c = '\r'; |
1503 | else if (stricmp (name + 1, "tab") == 0) |
1500 | else if (stricmp (name + 1, "tab") == 0) |
1504 | c = '\t'; |
1501 | c = '\t'; |
1505 | else if (name[1] == 'x' && name[2] != 0) |
1502 | else if (name[1] == 'x' && name[2] != 0) |
1506 | { |
1503 | { |
1507 | int c1 = strtol (name + 2, 0, 16); |
1504 | long c1 = strtol (name + 2, 0, 16); |
1508 | |
1505 | |
1509 | if (c1 <= UCHAR_MAX) |
1506 | if (0 <= c1 && c1 <= UCHAR_MAX) |
1510 | c = c1; |
1507 | c = c1; |
1511 | else |
1508 | else |
1512 | return NIL; |
1509 | return NIL; |
1513 | |
1510 | } |
1514 | #if USE_ASCII_NAMES |
1511 | #if USE_ASCII_NAMES |
1515 | } |
|
|
1516 | else if (is_ascii_name (name + 1, &c)) |
1512 | else if (is_ascii_name (name + 1, &c)) |
1517 | { |
|
|
1518 | /* nothing */ |
1513 | /* nothing */; |
1519 | #endif |
1514 | #endif |
1520 | } |
|
|
1521 | else if (name[2] == 0) |
1515 | else if (name[2] == 0) |
1522 | c = name[1]; |
1516 | c = name[1]; |
1523 | else |
1517 | else |
1524 | return NIL; |
1518 | return NIL; |
1525 | |
1519 | |