Changeset 11605


Ignore:
Timestamp:
Jan 10, 2009, 9:47:51 AM (11 years ago)
Author:
gb
Message:

%CNSTCMP (should have named it after "strncmp", which actually exists)
returns T iff the first N characters of two cstrings are equal.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/l0-misc.lisp

    r11135 r11605  
    456456      (return t))))
    457457
     458(defun %cnstrcmp (x y n)
     459  (declare (fixnum n))
     460  (do* ((i 0 (1+ i))
     461        (bx (%get-byte x i) (%get-byte x i))
     462        (by (%get-byte y i) (%get-byte y i)))
     463       ((= i n) t)
     464    (declare (fixnum i bx by))
     465    (unless (= bx by)
     466      (return))))
     467
    458468(defvar %documentation nil)
    459469
Note: See TracChangeset for help on using the changeset viewer.