summaryrefslogtreecommitdiff
path: root/include/str.h
blob: 983b3fc7472d2d12841c0414765413040ee29466 (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
#ifndef STR_H
#define STR_H

/*
 * Revision 20170918, Kai Peter
 * - added 'str_copyb()', thanks Erwin Hoffmann
 * Revision 20170501, Kai Peter
 * - added '*str_append' and 'str_cat'
 */

extern unsigned int str_copy(char *, const char *);
extern unsigned int str_copyb(char *, const char *, unsigned int);
extern int str_diff(const char *, const char *);
extern int str_diffn(const char *, const char *, unsigned int);
extern unsigned int str_len(const char *);
extern unsigned int str_chr(const char *, int);
extern unsigned int str_rchr(const char *, int);
extern int str_start(const char *, const char *);
extern char *str_append(char *out, const char *s);

#define str_equal(s, t) (!str_diff((s), (t)))
#define str_cat(s, t)   str_append(s, t)

#endif