implemented read/write/read_line/write_line/flush in h2-io-file.adb

This commit is contained in:
2014-06-06 16:44:45 +00:00
parent d78d6ffa1d
commit 1ac2a37358
6 changed files with 418 additions and 124 deletions

View File

@ -47,15 +47,23 @@ package body File is
V := V or Sysdef.O_RDONLY;
end if;
if ((Bits and FLAG_CREATE) /= 0) then
if (Bits and FLAG_CREATE) /= 0 then
V := V or Sysdef.O_CREAT;
end if;
if ((Bits and FLAG_TRUNCATE) /= 0) then
if (Bits and FLAG_TRUNCATE) /= 0 then
V := V or Sysdef.O_TRUNC;
end if;
if ((Bits and FLAG_SYNC) /= 0) then
if (Bits and FLAG_APPEND) /= 0 then
V := V or Sysdef.O_APPEND;
end if;
if (Bits and FLAG_NONBLOCK) /= 0 then
V := V or Sysdef.O_NONBLOCK;
end if;
if (Bits and FLAG_SYNC) /= 0 then
V := V or Sysdef.O_SYNC;
end if;

View File

@ -32,6 +32,12 @@ int main (int argc, char* argv[])
printf ("\tO_CREAT: constant := %d;\n", O_CREAT);
printf ("\tO_EXCL: constant := %d;\n", O_EXCL);
printf ("\tO_TRUNC: constant := %d;\n", O_TRUNC);
printf ("\tO_APPEND: constant := %d;\n", O_APPEND);
#if !defined(O_NONBLOCK)
# define O_NONBLOCK 0
#endif
printf ("\tO_NONBLOCK: constant := %d;\n", O_NONBLOCK);
#if !defined(O_SYNC)
# define O_SYNC 0