File: dbf\unsigned_io.ads
1 --::::::::::
2 --unsignio.ads
3 --::::::::::
4 -- Developed by (C) Wasiliy W. Molostoff 1994, 1995.
5 -- Moscow, Russia,
6 -- Voice: 7 (095) 398-23-38
7 -- e-mail: edv@edv.msk.ru
8 -- This is free software; you can freely redistribute it and/or
9 -- modify it without any restrictions. Please report any errors.
10 -- All corrections will be made as soon as possible.
11 with io_exceptions,
12 unsigned;
13 use unsigned;
14 package unsigned_io is
15
16 type file_type is limited private;
17
18 type file_mode is (in_file, inout_file, out_file);
19 subtype count is long_integer range 0 .. long_integer'last;
20 subtype positive_count is count range 1 .. count'last;
21
22 procedure create(file : in out file_type;
23 mode : in file_mode := inout_file;
24 name : in string := "";
25 form : in string := "");
26
27 procedure open(file : in out file_type;
28 mode : in file_mode;
29 name : in string;
30 form : in string := "");
31
32 procedure close(file : in out file_type);
33 procedure delete(file : in out file_type);
34 procedure reset(file : in out file_type;
35 mode : in file_mode);
36 procedure reset(file : in out file_type);
37
38 function mode(file : in file_type) return file_mode;
39 function name(file : in file_type) return string;
40
41 function form(file : in file_type) return string;
42 function is_open(file : in file_type) return boolean;
43
44 procedure read(file : in file_type; item : out byte);
45 procedure write(file: in file_type; item: in byte);
46 pragma inline (read, write);
47
48 procedure read(file : in file_type; item : out byte_string);
49 procedure write(file: in file_type; item: in byte_string);
50 pragma inline (read, write);
51
52 generic
53 type data_type is private;
54 procedure write_bytes (file: in out file_type;
55 data: in data_type);
56
57 generic
58 type data_type is private;
59 procedure read_bytes (file: in out file_type;
60 data: out data_type);
61
62 procedure set_index(file: in file_type; to: in positive_count);
63 function index(file : in file_type) return positive_count;
64 function size(file : in file_type) return count;
65 function end_of_file(file : in file_type) return boolean;
66
67 -- exceptions:
68
69 status_error : exception renames io_exceptions.status_error;
70 mode_error : exception renames io_exceptions.mode_error;
71 name_error : exception renames io_exceptions.name_error;
72 use_error : exception renames io_exceptions.use_error;
73 device_error : exception renames io_exceptions.device_error;
74 end_error : exception renames io_exceptions.end_error;
75 data_error : exception renames io_exceptions.data_error;
76
77 private
78 type file_object;
79 type file_type is access file_object;
80
81 end unsigned_io;
82