-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstdlib.h
37 lines (26 loc) · 1006 Bytes
/
stdlib.h
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
/*-------------------------------------------------------------
* stdlib.h
*
* Header file for standard library functions.
*-------------------------------------------------------------*/
#ifndef STDLIB_H
#define STDLIB_H
#include "syscall.h"
#define null 0L
#define true 1
#define false 0
#define min(a,b) (((a) < (b)) ? (a) : (b))
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define divRoundDown(n,s) ((n) / (s))
#define divRoundUp(n,s) (((n) / (s)) + ((((n) % (s)) > 0) ? 1 : 0))
#define assert(_EX) ((_EX) ? (void) 0 : __assert(__FILE__, __LINE__))
void __assert(char* file, int line);
#define assertNotReached() assert(false)
void *memcpy(void *s1, const void *s2, unsigned int n);
void *memset(void *s, int c, unsigned int n);
unsigned int strlen(const char *str);
char *strcpy(char *dst, const char *src);
int strcmp(const char *a, const char *b);
int strncmp(const char *a, const char *b, int n);
int atoi(const char *s);
#endif // STDLIB_H