2021-11-05 23:02:23 +01:00
|
|
|
#pragma once
|
|
|
|
#include "assert.h"
|
|
|
|
#include "stdarg.h"
|
|
|
|
#include "minmax.h"
|
|
|
|
|
|
|
|
#define islower(c) (('a' <= (c)) && ((c) <= 'z'))
|
|
|
|
#define isupper(c) (('A' <= (c)) && ((c) <= 'Z'))
|
|
|
|
#define isdigit(c) (('0' <= (c)) && ((c) <= '9'))
|
|
|
|
#define isspace(c) \
|
|
|
|
(((c) == ' ') || ((c) == '\t') || ((c) == '\f') || ((c) == '\n') || ((c) == '\r') || \
|
|
|
|
((c) == '\v'))
|
|
|
|
#define isprint(c) ((' ' <= (c)) && ((c) <= '~'))
|
2023-03-21 22:41:17 +01:00
|
|
|
#define EOF (-1)
|
|
|
|
|
2021-11-05 23:02:23 +01:00
|
|
|
|
2023-11-08 21:55:11 +01:00
|
|
|
__attribute__ ((access (read_only, 1, 3), access (read_only, 2, 3))) int memcmp(const void *s1, const void *s2, size_t n);
|
|
|
|
__attribute__ ((access (write_only, 1, 3), access (read_only, 2, 3))) void *memcpy(void *dest, const void *src, size_t n);
|
|
|
|
__attribute__ ((access (write_only, 1, 3))) void *memset(void *s, int c, size_t n);
|
2021-11-05 23:02:23 +01:00
|
|
|
char *itoa(long long int value, char *str, int base);
|
|
|
|
void reverse(char s[]);
|
|
|
|
int strlen(const char s[]);
|
2023-11-08 21:55:11 +01:00
|
|
|
__attribute__ ((access (read_only, 1, 2))) unsigned int strnlen(const char *s, size_t count);
|
2021-11-05 23:02:23 +01:00
|
|
|
int strcmp(const char s1[], const char s2[]);
|
2023-11-08 21:55:11 +01:00
|
|
|
__attribute__ ((access (read_only, 2), access (write_only, 1, 3))) char *strzcpy(char *dst, const char *src, int len);
|
2021-11-05 23:02:23 +01:00
|
|
|
int puts(const char *str);
|
|
|
|
int putc(const int c);
|
2023-11-09 20:30:09 +01:00
|
|
|
int vsnprintf(char *str, size_t size, const char *format, va_list ap) __attribute__ ((__format__ (printf, 3, 0)));
|
|
|
|
int vprintf(const char *format, va_list ap) __attribute__ ((__format__ (printf, 1, 0)));
|
|
|
|
int printf(const char *format, ...) __attribute__ ((__format__ (printf, 1, 2)));
|
2021-11-05 23:02:23 +01:00
|
|
|
|
|
|
|
// Could be used after malloc is available
|
2023-11-09 20:30:09 +01:00
|
|
|
int asprintf(char **strp, const char *fmt, ...) __attribute__ ((__format__ (printf, 2, 3)));
|
|
|
|
int vasprintf(char **strp, const char *fmt, va_list ap) __attribute__ ((__format__ (printf, 2, 0)));
|
2021-11-05 23:02:23 +01:00
|
|
|
|
2021-11-08 23:22:03 +01:00
|
|
|
int syscall5(int id, unsigned int arg1, unsigned int arg2, unsigned int arg3,
|
|
|
|
unsigned int arg4, unsigned int arg5);
|
|
|
|
int syscall4(int id, unsigned int arg1, unsigned int arg2, unsigned int arg3,
|
|
|
|
unsigned int arg4);
|
2021-11-05 23:02:23 +01:00
|
|
|
int syscall3(int id, unsigned int arg1, unsigned int arg2, unsigned int arg3);
|
|
|
|
int syscall2(int id, unsigned int arg1, unsigned int arg2);
|
|
|
|
int syscall1(int id, unsigned int arg1);
|
|
|
|
int syscall0(int id);
|
|
|
|
|
|
|
|
void _exit(int status);
|
|
|
|
void yolo();
|
2021-11-08 23:22:03 +01:00
|
|
|
int testSycall5(uint arg1, uint arg2, uint arg3, uint arg4, uint arg5);
|
2021-11-06 00:13:40 +01:00
|
|
|
char readc();
|
2023-03-21 22:41:17 +01:00
|
|
|
char getchar();
|
2021-11-06 00:13:40 +01:00
|
|
|
int readline(char *buf, int size);
|
2022-08-09 16:15:00 +02:00
|
|
|
void *brk(void *addr);
|
2023-03-21 22:41:17 +01:00
|
|
|
void *malloc(size_t size);
|