summaryrefslogtreecommitdiff
path: root/src/user/lib/libc/include/string.h
blob: 2f4f4ca9656f4e1fc485084c35e84edc03f5f5e2 (plain) (blame)
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
#ifndef DEF_LIB_STRING_H
#define DEF_LIB_STRING_H

#include <types.h>
#include <stdarg.h>

#ifdef __cplusplus
extern "C" { namespace libc {
#endif

void *memcpy(void *dest, const void *src, int count);
void *memset(void *dest, int val, int count);
uint16_t *memsetw(uint16_t *dest, uint16_t val, int count);

int strlen(const char *str);
char *strcpy(char *dest, const char *src);
char *strdup(const char *src);
char *strchr(const char *str, int c);
char *strcat(char *dest, const char *src);
int strcmp(const char *s1, const char *s2);
char *strncpy(char *dest, const char *src, int max);

char* format_int(char* buf, int number);
char* format_hex(char *buf, unsigned v);
int printf_str_len(const char *fmt, va_list arg);
int vsprintf(char *buf, const char *fmt, va_list arg);
int sprintf(char *buf, const char *fmt, ...);


void simplify_path(char *p);		// simplifies /../, // and /./
char *path_cat(const char *a, const char *b, int trailing_slash);	// allocates a new buffer

#ifdef __cplusplus
} }
#endif


#endif