| 1 |
(* RTio.def provides low level routines for creating and destroying ChanIds. |
| 2 |
|
| 3 |
Copyright (C) 2008-2025 Free Software Foundation, Inc. |
| 4 |
Contributed by Gaius Mulley <[email protected]>. |
| 5 |
|
| 6 |
This file is part of GNU Modula-2. |
| 7 |
|
| 8 |
GNU Modula-2 is free software; you can redistribute it and/or modify |
| 9 |
it under the terms of the GNU General Public License as published by |
| 10 |
the Free Software Foundation; either version 3, or (at your option) |
| 11 |
any later version. |
| 12 |
|
| 13 |
GNU Modula-2 is distributed in the hope that it will be useful, but |
| 14 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 |
General Public License for more details. |
| 17 |
|
| 18 |
Under Section 7 of GPL version 3, you are granted additional |
| 19 |
permissions described in the GCC Runtime Library Exception, version |
| 20 |
3.1, as published by the Free Software Foundation. |
| 21 |
|
| 22 |
You should have received a copy of the GNU General Public License and |
| 23 |
a copy of the GCC Runtime Library Exception along with this program; |
| 24 |
see the files COPYING3 and COPYING.RUNTIME respectively. If not, see |
| 25 |
<http://www.gnu.org/licenses/>. *) |
| 26 |
|
| 27 |
DEFINITION MODULE RTio ; |
| 28 |
|
| 29 |
(* |
| 30 |
Title : RTio |
| 31 |
Author : Gaius Mulley |
| 32 |
System : GNU Modula-2 |
| 33 |
Date : Sun Sep 7 16:32:48 2008 |
| 34 |
Revision : $Version$ |
| 35 |
Description: provides low level routines for creating and destroying |
| 36 |
ChanIds. This is necessary to allow multiple modules |
| 37 |
to create, ChanId values, where ChanId is an opaque |
| 38 |
type. |
| 39 |
*) |
| 40 |
|
| 41 |
IMPORT FIO, IOLink ; |
| 42 |
|
| 43 |
TYPE |
| 44 |
ChanId ; |
| 45 |
|
| 46 |
|
| 47 |
(* |
| 48 |
InitChanId - return a new ChanId. |
| 49 |
*) |
| 50 |
|
| 51 |
PROCEDURE InitChanId () : ChanId ; |
| 52 |
|
| 53 |
|
| 54 |
(* |
| 55 |
KillChanId - deallocate a ChanId. |
| 56 |
*) |
| 57 |
|
| 58 |
PROCEDURE KillChanId (c: ChanId) : ChanId ; |
| 59 |
|
| 60 |
|
| 61 |
(* |
| 62 |
NilChanId - return a NIL pointer. |
| 63 |
*) |
| 64 |
|
| 65 |
PROCEDURE NilChanId () : ChanId ; |
| 66 |
|
| 67 |
|
| 68 |
(* |
| 69 |
GetDeviceId - returns the device id, from, c. |
| 70 |
*) |
| 71 |
|
| 72 |
PROCEDURE GetDeviceId (c: ChanId) : IOLink.DeviceId ; |
| 73 |
|
| 74 |
|
| 75 |
(* |
| 76 |
SetDeviceId - sets the device id in, c. |
| 77 |
*) |
| 78 |
|
| 79 |
PROCEDURE SetDeviceId (c: ChanId; d: IOLink.DeviceId) ; |
| 80 |
|
| 81 |
|
| 82 |
(* |
| 83 |
GetDevicePtr - returns the device table ptr, from, c. |
| 84 |
*) |
| 85 |
|
| 86 |
PROCEDURE GetDevicePtr (c: ChanId) : IOLink.DeviceTablePtr ; |
| 87 |
|
| 88 |
|
| 89 |
(* |
| 90 |
SetDevicePtr - sets the device table ptr in, c. |
| 91 |
*) |
| 92 |
|
| 93 |
PROCEDURE SetDevicePtr (c: ChanId; p: IOLink.DeviceTablePtr) ; |
| 94 |
|
| 95 |
|
| 96 |
(* |
| 97 |
GetFile - returns the file field from, c. |
| 98 |
*) |
| 99 |
|
| 100 |
PROCEDURE GetFile (c: ChanId) : FIO.File ; |
| 101 |
|
| 102 |
|
| 103 |
(* |
| 104 |
SetFile - sets the file field in, c. |
| 105 |
*) |
| 106 |
|
| 107 |
PROCEDURE SetFile (c: ChanId; f: FIO.File) ; |
| 108 |
|
| 109 |
|
| 110 |
END RTio. |