c_src: update
[nit.git] / c_src / kernel_nit.h
similarity index 66%
rename from c_src/stream_nit.c
rename to c_src/kernel_nit.h
index 14bfece..3a09c9c 100644 (file)
@@ -1,7 +1,7 @@
+#ifndef __KERNEL_NIT_H
+#define __KERNEL_NIT_H
 /* This file is part of NIT ( http://www.nitlanguage.org ).
  *
- * Copyright 2004-2008 Jean Privat <jean@pryen.org>
- *
  * This file is free software, which comes along with NIT.  This software is
  * distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  * without  even  the implied warranty of  MERCHANTABILITY or  FITNESS FOR A 
  * another product.
  */
 
-#include "stream_nit.h"
+#include <stdlib.h>
+
+#define address_is_null(x) ((x)==NULL)
 
-int stream_FDStream_FDStream_native_read_char_1(void *s, int fd) {
-       int result;
-       char buf;
-       ssize_t r = read(fd, &buf, 1);
-       if (r == 0)
-               result = -1;
-       else
-               result = buf;
-       return result;
-}
+#endif