| 123456789101112131415161718192021 |
- DEFINITION MODULE Strings;
- (* Bounded string operations over descriptor strings (classic
- Modula-2 form). Sources are [0..] indexed; destinations are
- truncated to fit (never overrun). *)
- PROCEDURE Length(VAR s : ARRAY OF CHAR) : INTEGER;
- (* Number of characters in s. *)
- PROCEDURE Assign(VAR src, dst : ARRAY OF CHAR);
- (* Copies src into dst (truncated to dst's capacity). *)
- PROCEDURE Concat(VAR s1, s2 : ARRAY OF CHAR; VAR dst : ARRAY OF CHAR);
- (* dst := s1 followed by s2 (truncated to fit). *)
- PROCEDURE Compare(VAR s1, s2 : ARRAY OF CHAR) : INTEGER;
- (* <0, 0 or >0 as s1 is less than, equal to, or greater than s2. *)
- PROCEDURE Copy(VAR src, dst : ARRAY OF CHAR);
- (* Alias for Assign, ISO-style name. *)
- END Strings.
|