summaryrefslogtreecommitdiff
path: root/include/lib.h
blob: 065177054943749d7e4975e74e000a5c8b40b169 (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
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once

/**
 * The  memcmp() function compares the first n bytes (each interpreted as unsigned char) of the memory
 * areas s1 and s2.
 */
extern int memcmp(const void *restrict s1, const void *restrict s2, unsigned long n);

/**
 * The  memcpy()  function  copies n bytes from memory area src to memory area dest.
 * The memory areas must not overlap.
 */
extern void *memcpy(void *restrict dest, const void *restrict src, unsigned long n);

/**
 * The  memmove()  function copies n bytes from memory area src to memory area dest.  The memory areas
 * may overlap: copying takes place as though the bytes in src are first copied into a temporary array
 * that does not overlap src or dest, and the bytes are then copied from the temporary array to dest.
 */
extern void *memmove(void *dest, const void *src, unsigned long n);

/**
 * The  memset() function fills the first n bytes of the memory area pointed to by s with the constant
 * byte c.
 */
extern void *memset(void *restrict dest, int c, unsigned long n);

/**
 * The  strcmp()  function  compares  the two strings s1 and s2.  The locale is not taken into account
 * (for a locale-aware comparison, see strcoll(3)).  The comparison is done using unsigned characters.
 */
extern int strncmp(const char *restrict s1, const char *restrict s2, unsigned long n);

/**
 * @returns 1 if c is a space
 */
int isspace(int c);

/**
 * @returns 1 if c is a digit (0 - 9)
 */
int isdigit(int c);


char itoc(int i);
int ctoi(char c);

int atoi(const char* s);
long int atol(const char* s);
long long int atoll(const char* s);

char *itoa(int n, char *buffer, int radix);
char *ltoa(long int n, char *buffer, int radix);
char *utoa(unsigned int n, char *buffer, int radix);
char *ultoa(unsigned long int n, char *buffer, int radix);
char *ftoa(float f, char *buffer);

int strtoi(const char *str, char **endptr, int base);
long int strtol(const char *str, char **endptr, int base);
long long int strtoll(const char *str, char **endptr, int base);