errno = errno_;
return feach_res;
}
+
+HEADER // requires stdio.h
+HEADER #define FDIR_FOREACH(dir, element_name, code) { \
+HEADER struct dirent element_name; \
+HEADER struct dirent *__jh_fdir_foreach_res; \
+HEADER while (1) { \
+HEADER int __jh_fdir_foreach_rd_res = readdir_r(dir, &element_name, &__jh_fdir_foreach_res); \
+HEADER if(__jh_fdir_foreach_rd_res) {*(char*)0 = 0; /*crash, boom – EBADF happened (probably)*/} \
+HEADER if (__jh_fdir_foreach_res == NULL) goto end; \
+HEADER {code} \
+HEADER } \
+HEADER end:; \
+HEADER }
\ No newline at end of file