nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: Android support improvements
[nit.git]
/
c_src
/
file_nit.c
diff --git
a/c_src/file_nit.c
b/c_src/file_nit.c
index
e38a384
..
06f5e2e
100644
(file)
--- a/
c_src/file_nit.c
+++ b/
c_src/file_nit.c
@@
-6,7
+6,7
@@
*
* 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;
*
* 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
+ * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. You can modify it is you want, provided this header
* is kept unaltered, and a notification of the changes is added.
* You are allowed to redistribute it and sell it, alone or is a part of
* PARTICULAR PURPOSE. You can modify it is you want, provided this header
* is kept unaltered, and a notification of the changes is added.
* You are allowed to redistribute it and sell it, alone or is a part of
@@
-19,6
+19,10
@@
#include <unistd.h>
#include <sys/types.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <string.h>
+#include <dirent.h>
+#include <poll.h>
+
+#include "file_nit.h"
int string_NativeString_NativeString_file_exists_0(char *f){
FILE *hdl = fopen(f,"r");
int string_NativeString_NativeString_file_exists_0(char *f){
FILE *hdl = fopen(f,"r");
@@
-51,3
+55,13
@@
void *file_NativeFile_NativeFile_file_stat_0(FILE *f){
extern int string_NativeString_NativeString_file_delete_0(char *f){
return (remove(f) == 0);
}
extern int string_NativeString_NativeString_file_delete_0(char *f){
return (remove(f) == 0);
}
+
+int file_stdin_poll_in_(void) {
+ struct pollfd fd = {0, POLLIN, 0};
+ int res = poll(&fd, 1, 0);
+ if (res == -1) {
+ perror("Error poll stdin");
+ exit(EXIT_FAILURE);
+ }
+ return res > 0;
+}