mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-23 12:00:21 +02:00
* Deprecated SCM_RWSTRINGP and SCM_VALIDATE_RWSTRING.
* Prepared SCM_STRING_U?CHARS to replace SCM_ROU?CHARS.
This commit is contained in:
parent
c2c2760293
commit
f0942910af
8 changed files with 40 additions and 9 deletions
|
@ -52,13 +52,12 @@
|
|||
|
||||
|
||||
#define SCM_STRINGP(x) (SCM_NIMP (x) && (SCM_TYP7S (x) == scm_tc7_string))
|
||||
#if (SCM_DEBUG_DEPRECATED == 1)
|
||||
#define SCM_STRING_UCHARS(x) ((unsigned char *) (SCM_CELL_WORD_1 (x)))
|
||||
#define SCM_STRING_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x)))
|
||||
#endif
|
||||
#define SCM_STRING_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8)
|
||||
|
||||
/* Is X a writable string (i.e., not a substring)? */
|
||||
#define SCM_RWSTRINGP(x) (SCM_NIMP (x) && (SCM_TYP7 (x) == scm_tc7_string))
|
||||
|
||||
#define SCM_STRING_COERCE_0TERMINATION_X(x) \
|
||||
{ if (SCM_NIMP (x) && (SCM_TYP7 (x) == scm_tc7_substring)) \
|
||||
x = scm_makfromstr (SCM_ROCHARS (x), SCM_STRING_LENGTH (x), 0); }
|
||||
|
@ -89,7 +88,16 @@ extern void scm_init_strings (void);
|
|||
|
||||
#define SCM_SLOPPY_STRINGP(x) (SCM_STRINGP(x))
|
||||
#define SCM_NSTRINGP(x) (!SCM_STRINGP(x))
|
||||
#define SCM_RWSTRINGP(x) (SCM_NIMP (x) && (SCM_TYP7 (x) == scm_tc7_string))
|
||||
#define SCM_NRWSTRINGP(x) (! SCM_RWSTRINGP (x))
|
||||
#define SCM_STRING_UCHARS(x) \
|
||||
((SCM_TYP7 (x) == scm_tc7_substring) \
|
||||
? (unsigned char *) SCM_CELL_WORD_1 (SCM_CDDR (x)) + SCM_INUM (SCM_CADR (x)) \
|
||||
: (unsigned char *) SCM_CELL_WORD_1 (x))
|
||||
#define SCM_STRING_CHARS(x) \
|
||||
((SCM_TYP7 (x) == scm_tc7_substring) \
|
||||
? (char *) SCM_CELL_WORD_1 (SCM_CDDR (x)) + SCM_INUM (SCM_CADR (x)) \
|
||||
: (char *) SCM_CELL_WORD_1 (x))
|
||||
extern SCM scm_make_shared_substring (SCM str, SCM frm, SCM to);
|
||||
|
||||
#endif /* SCM_DEBUG_DEPRECATED == 0 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue