INCFILES := stdio.h stdlib.h\r
\r
OBJ = stub.o heap.o stdlib.o env.o fileIO.o string.o select.o rand.o\r
+OBJ += perror.o\r
OBJ += arch/$(ARCHDIR).ao\r
# signals.o\r
DEPFILES := $(OBJ:%.o=%.d)\r
///\todo Implement\r
}\r
\r
+EXPORT void clearerr(FILE *stream)\r
+{\r
+ /// \todo Impliment\r
+}\r
+\r
+EXPORT int feof(FILE *stream)\r
+{\r
+ return 0; //stream->; // ?\r
+}\r
+\r
+EXPORT int ferror(FILE *stream)\r
+{\r
+ return 0;\r
+}\r
+EXPORT int fileno(FILE *stream)\r
+{\r
+ return stream->FD;\r
+}\r
+\r
EXPORT off_t ftell(FILE *fp)\r
{\r
if(!fp || !fp->FD) return -1;\r
--- /dev/null
+/*
+ * Acess2 C Library
+ * - By John Hodge (thePowersGang)
+ *
+ * assert.h
+ * - assert(expr)
+ */
+#ifndef _LIBC__ASSERT_H_
+#define _LIBC__ASSERT_H_
+
+#ifdef NDEBUG
+# define assert(expr) do{}while(0)
+#else
+# define assert(expr) do{if(!(expr)) { fprintf(stderr, "%s:%i: Assertion '%s' failed\n", __FILE__, __LINE__, #expr); exit(-1);}}while(0)
+#endif
+
+#endif
+
extern int vsprintf(char *buf, const char *format, va_list args);
extern int sprintf(char *buf, const char *format, ...);
extern int snprintf(char *buf, size_t maxlen, const char *format, ...);
+extern void perror(const char *s);
extern FILE *fopen(const char *file, const char *mode);
extern FILE *freopen(const char *file, const char *mode, FILE *fp);
extern void fflush(FILE *fp);
extern off_t ftell(FILE *fp);
extern int fseek(FILE *fp, long int amt, int whence);
+extern void clearerr(FILE *stream);
+extern int feof(FILE *stream);
+extern int ferror(FILE *stream);
+extern int fileno(FILE *stream);
extern size_t fread(void *buf, size_t size, size_t n, FILE *fp);
extern size_t fwrite(void *buf, size_t size, size_t n, FILE *fp);
--- /dev/null
+/*
+ * Acess2 C Library
+ * - By John Hodge (thePowersGang)
+ *
+ * perror.c
+ * - perror() and friends
+ */
+#include <errno.h>
+#include <stdio.h>
+
+void perror(const char *s)
+{
+ fprintf(stderr, "%s: Error (%i)\n", s, errno);
+}
# Variables
SRCS := stub.c heap.c stdlib.c env.c fileIO.c string.c select.c
+SRCS += perror.c
SRCS += arch/$(ARCHDIR).$(ASSUFFIX)
# signals.c
BIN := $(OUTPUTDIR)Libs/libc.so