summaryrefslogtreecommitdiff
path: root/src/string.h
blob: d74a970739ff20e5c8f2484bd887b00c531b6c38 (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

#ifndef STRING_H
#define STRING_H

#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>

int memcmp(const void *s1, const void *s2, size_t n);
void *memcpy(void *dest, const void *src, size_t n);
void *memmove(void *dest, const void *src, size_t n);
void *memset(void *s, int c, size_t n);
size_t strlen(const char *s);
char *strcpy(char *dest, const char *src);
char *strncpy(char *dest, const char *src, size_t n);
int strcmp(const char *s1, const char *s2);
int strncmp(const char *s1, const char *s2, size_t n);
char *strstr(const char *haystack, const char *needle);
char *strchr(const char *s, int c);
size_t strspn(const char *s, const char *accept);

char *hex(uint32_t n, char *buf);

bool isupper(char c);
bool islower(char c);
bool isalpha(char c);
bool isdigit(char c);
bool isxdigit(char c);
bool isalnum(char c);
bool isspace(char c);

char toupper(char c);
char tolower(char c);

#endif