1
0
mirror of https://github.com/janet-lang/janet synced 2024-12-26 00:10:27 +00:00

Merge pull request #1063 from AlecTroemel/1062-io-flag-types

use int32_t type for file flags, just like header
This commit is contained in:
Calvin Rose 2023-01-22 10:56:19 -06:00 committed by GitHub
commit 987e04086d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -718,17 +718,17 @@ JanetFile *janet_getjfile(const Janet *argv, int32_t n) {
return janet_getabstract(argv, n, &janet_file_type); return janet_getabstract(argv, n, &janet_file_type);
} }
FILE *janet_getfile(const Janet *argv, int32_t n, int *flags) { FILE *janet_getfile(const Janet *argv, int32_t n, int32_t *flags) {
JanetFile *iof = janet_getabstract(argv, n, &janet_file_type); JanetFile *iof = janet_getabstract(argv, n, &janet_file_type);
if (NULL != flags) *flags = iof->flags; if (NULL != flags) *flags = iof->flags;
return iof->file; return iof->file;
} }
JanetFile *janet_makejfile(FILE *f, int flags) { JanetFile *janet_makejfile(FILE *f, int32_t flags) {
return makef(f, flags); return makef(f, flags);
} }
Janet janet_makefile(FILE *f, int flags) { Janet janet_makefile(FILE *f, int32_t flags) {
return janet_wrap_abstract(makef(f, flags)); return janet_wrap_abstract(makef(f, flags));
} }
@ -736,7 +736,7 @@ JanetAbstract janet_checkfile(Janet j) {
return janet_checkabstract(j, &janet_file_type); return janet_checkabstract(j, &janet_file_type);
} }
FILE *janet_unwrapfile(Janet j, int *flags) { FILE *janet_unwrapfile(Janet j, int32_t *flags) {
JanetFile *iof = janet_unwrap_abstract(j); JanetFile *iof = janet_unwrap_abstract(j);
if (NULL != flags) *flags = iof->flags; if (NULL != flags) *flags = iof->flags;
return iof->file; return iof->file;