Changeset 6560
- Timestamp:
- May 16, 2007, 1:33:51 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/ccl/level-1/l1-unicode.lisp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ccl/level-1/l1-unicode.lisp
r6554 r6560 4615 4615 4616 4616 4617 4617 (defun string-encoded-length-in-bytes (encoding string start end) 4618 (if (typep string 'simple-base-string) 4619 (funcall (character-encoding-octets-in-string-function encoding) 4620 string 4621 (or start 0) 4622 (or end (length string))) 4623 (let* ((s (string string))) 4624 (multiple-value-bind (data offset) (array-data-and-offset s) 4625 (funcall (character-encoding-octets-in-string-function encoding) 4626 data 4627 (+ offset (or start 0)) 4628 (+ offset (or end (length s)))))))) 4629 4630 ;;; Same as above, but add the length of a trailing 0 code-unit. 4618 4631 (defun cstring-encoded-length-in-bytes (encoding string start end) 4619 (+ (length (character-encoding-nul-encoding encoding)) ; NUL terminator 4620 (funcall (character-encoding-octets-in-string-function encoding) 4621 string 4622 (or start 0) 4623 (or end (length string))))) 4624 4625 4632 (+ (ash (character-encoding-code-unit-size encoding) -3) ; NUL terminator 4633 (string-encoded-length-in-bytes string start end))) 4634 4635 4626 4636 4627 4637 (defun encode-string-to-memory (encoding pointer offset string start end) 4628 (funcall (character-encoding-memory-encode-function encoding) 4629 string pointer offset (or start 0) (or end (length string)))) 4638 (if (typep string 'simple-base-string) 4639 (funcall (character-encoding-memory-encode-function encoding) 4640 string pointer offset (or start 0) (or end (length string))) 4641 (let* ((s (string string))) 4642 (multiple-value-bind (data data-offset) 4643 (array-data-and-offset s) 4644 (funcall (character-encoding-memory-encode-function encoding) 4645 data pointer offset (+ data-offset (or start 0)) (+ data-offset (or end (length s)))))))) 4646
Note:
See TracChangeset
for help on using the changeset viewer.
