blob: d069989db4b4439104b4d7fca087d7e628cb81f8 [file] [log] [blame]
Kevin O'Connorfa9c66a2013-09-14 19:10:40 -04001// String manipulation function defs.
2#ifndef __STRING_H
3#define __STRING_H
4
5#include "types.h" // u32
6
7// string.c
8u8 checksum_far(u16 buf_seg, void *buf_far, u32 len);
9u8 checksum(void *buf, u32 len);
10size_t strlen(const char *s);
Paolo Bonzini60e0e552015-01-02 12:32:25 -050011int memcmp_far(u16 s1seg, const void *s1, u16 s2seg, const void *s2, size_t n);
Kevin O'Connorfa9c66a2013-09-14 19:10:40 -040012int memcmp(const void *s1, const void *s2, size_t n);
13int strcmp(const char *s1, const char *s2);
Kevin O'Connorbe050662015-06-01 18:32:06 -040014void memset_far(u16 d_seg, void *d_far, u8 c, size_t len);
15void memset16_far(u16 d_seg, void *d_far, u16 c, size_t len);
Kevin O'Connorfa9c66a2013-09-14 19:10:40 -040016void *memset(void *s, int c, size_t n);
17void memset_fl(void *ptr, u8 val, size_t size);
Kevin O'Connorbe050662015-06-01 18:32:06 -040018void memcpy_far(u16 d_seg, void *d_far
19 , u16 s_seg, const void *s_far, size_t len);
Kevin O'Connorfa9c66a2013-09-14 19:10:40 -040020void memcpy_fl(void *d_fl, const void *s_fl, size_t len);
21void *memcpy(void *d1, const void *s1, size_t len);
22#if MODESEGMENT == 0
23#define memcpy __builtin_memcpy
24#endif
25void iomemcpy(void *d, const void *s, u32 len);
26void *memmove(void *d, const void *s, size_t len);
27char *strtcpy(char *dest, const char *src, size_t len);
28char *strchr(const char *s, int c);
Kevin O'Connord15b0102014-01-31 19:38:36 -050029char *nullTrailingSpace(char *buf);
Kevin O'Connorfa9c66a2013-09-14 19:10:40 -040030
31#endif // string.h