aboutsummaryrefslogtreecommitdiff
path: root/stdlib/c89/string.lh
blob: 03e1fae6844cf1a1c11d94d2fc9bcdaf624be776 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

/*
  LRL version of ANSI C header <stdio.h>
  http://flash-gordon.me.uk/ansi.c.txt
*/

linkname "";

// 4.11 STRING HANDLING <string.h>
// 4.11.1 String function conventions

// In LRL the equivalent of "size_t" is "count" which is a builtin,
// so it's not redefined here. The same applies to "NULL" which is a
// builtin in LRL called "none".


// 4.11.2 Copying functions
var T+> memcpy[T](var T+> s1, T+> s2, count n);
var T+> memmove[T](shared var T+> s1, shared T+> s2, count n);
var byte+> strcpy(var byte+> s1, byte+> s2);
var byte+> strncpy(var byte+> s1, byte+> s2, count n);

// 4.11.3 Concatenation functions
var byte+> strcat(var byte+> s1, byte+> s2);
var byte+> strncat(var byte+> s1, byte+> s2, count n);

// 4.11.4 Comparison functions
int memcmp[T](T+> s1, T+> s2, count n);
int strcmp(byte+> s1, byte+> s2);
int strcoll(byte+> s1, byte+> s2);
int strncmp(byte+> s1, byte+> s2, count n);
count strxfrm(var byte+*> s1, byte+> s2, count n);

// 4.11.5 Search functions
var T+*> memchr[T](var T+> s, int c, count n);
var byte+*> strchr(byte+> s, int c);
count strcspn(byte+> s1, byte+> s2);
var byte+*> strpbrk(byte+> s1, byte+> s2);
var byte+*> strrchr(byte+> s, int c);
count strspn(byte+> s1, byte+> s2);
var byte+*> strstr(byte+> s1, byte+> s2);
var byte+*> strtok(byte+*> s1, byte+> s2);

// 4.11.6 Miscellaneous functions
byte+> memset(byte+> s, int c, count n);
byte+> strerror(int errnum);
count strlen(byte+> s);