]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/m2/gm2-libs/wrapc.def
90c14d128fb1e7429ad977fca5d6b6c99167b722
[thirdparty/gcc.git] / gcc / m2 / gm2-libs / wrapc.def
1 (* wrapc.def provides access to more of the C library.
2
3 Copyright (C) 2001-2023 Free Software Foundation, Inc.
4 Contributed by Gaius Mulley <gaius.mulley@southwales.ac.uk>.
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 wrapc ;
28
29 FROM SYSTEM IMPORT ADDRESS ;
30
31 EXPORT QUALIFIED strtime, filesize, fileinode,
32 getrand, getusername, filemtime,
33 getnameuidgid, signbit, signbitf, signbitl,
34 isfinite, isfinitel, isfinitef ;
35
36
37 (*
38 strtime - returns the C string for the equivalent C asctime
39 function.
40 *)
41
42 PROCEDURE strtime () : ADDRESS ;
43
44
45 (*
46 filesize - assigns the size of a file, f, into low, high and
47 returns zero if successful.
48 *)
49
50 PROCEDURE filesize (f: INTEGER; VAR low, high: CARDINAL) : INTEGER ;
51
52
53 (*
54 fileinode - return the inode associated with file, f.
55 *)
56
57 PROCEDURE fileinode (f: INTEGER; VAR low, high: CARDINAL) : INTEGER ;
58
59
60 (*
61 filemtime - returns the mtime of a file, f.
62 *)
63
64 PROCEDURE filemtime (f: INTEGER) : INTEGER ;
65
66
67 (*
68 getrand - returns a random number between 0..n-1
69 *)
70
71 PROCEDURE getrand (n: INTEGER) : INTEGER ;
72
73
74 (*
75 getusername - returns a C string describing the current user.
76 *)
77
78 PROCEDURE getusername () : ADDRESS ;
79
80
81 (*
82 getnameuidgid - fills in the, uid, and, gid, which represents
83 user, name.
84 *)
85
86 PROCEDURE getnameuidgid (name: ADDRESS; VAR uid, gid: INTEGER) ;
87
88
89 (*
90 in C these procedure functions are really macros, so we provide
91 real C functions and let gm2 call these if the builtins
92 are unavailable.
93 *)
94
95 PROCEDURE signbit (r: REAL) : INTEGER ;
96 PROCEDURE signbitf (s: SHORTREAL) : INTEGER ;
97 PROCEDURE signbitl (l: LONGREAL) : INTEGER ;
98
99
100 (*
101 isfinite - provide non builtin alternative to the gcc builtin isfinite.
102 Returns 1 if x is finite and 0 if it is not.
103 *)
104
105 PROCEDURE isfinite (x: REAL) : INTEGER ;
106
107
108 (*
109 isfinitef - provide non builtin alternative to the gcc builtin isfinite.
110 Returns 1 if x is finite and 0 if it is not.
111 *)
112
113 PROCEDURE isfinitef (x: SHORTREAL) : INTEGER ;
114
115
116 (*
117 isfinitel - provide non builtin alternative to the gcc builtin isfinite.
118 Returns 1 if x is finite and 0 if it is not.
119 *)
120
121 PROCEDURE isfinitel (x: LONGREAL) : INTEGER ;
122
123
124 END wrapc.