|
a |
|
b/UnixCalls.def.m2cc |
|
|
1 |
#ifdef __XDS__
|
|
|
2 |
DEFINITION MODULE ["C"] UnixCalls; (* XDS *)
|
|
|
3 |
#endif
|
|
|
4 |
#ifdef __GM2__
|
|
|
5 |
DEFINITION MODULE FOR "C" UnixCalls; (* GNU M2 *)
|
|
|
6 |
#endif
|
|
|
7 |
#ifdef __MOCKA__
|
|
|
8 |
FOREIGN MODULE UnixCalls; (* Mocka *)
|
|
|
9 |
#endif
|
|
|
10 |
|
|
|
11 |
(*========================================================================*)
|
|
|
12 |
(* WICHTIG: BITTE NUR DIE DATEI UnixCalls.def.m2cc EDITIEREN !!! *)
|
|
|
13 |
(*========================================================================*)
|
|
|
14 |
(* Aufrufe von UNIX Prozeduren mit "C" Huelle *)
|
|
|
15 |
(* Call to UNIX procedures with a "C" wrapper *)
|
|
|
16 |
(* *)
|
|
|
17 |
(* Es sind 3 Versionen enthalten die mit *)
|
|
|
18 |
(* *)
|
|
|
19 |
(* m2cc -D __{Parameter}__ < UnixCalls.def.m2cc > UnixCalls.def *)
|
|
|
20 |
(* *)
|
|
|
21 |
(* mit Parameter = {XDS|GM2} erzeugt werden koennen. *)
|
|
|
22 |
(* *)
|
|
|
23 |
(* XDS : Parameter werden fuer den XDS Modula-2 Compilter gesetzt *)
|
|
|
24 |
(* GM2 : Parameter werden fuer den GNU Modula-2 Compilter gesetzt *)
|
|
|
25 |
(* MOCKA : Parameter werden fuer den MOCKA Compilter gesetzt *)
|
|
|
26 |
(* *)
|
|
|
27 |
(* There are three version contained for XDS,GM2 and the Mocka compiler, *)
|
|
|
28 |
(* they can obtained with the m2cc command line shown above *)
|
|
|
29 |
(*------------------------------------------------------------------------*)
|
|
|
30 |
(* Implementation : Michael Riedl *)
|
|
|
31 |
(* Licence : GNU Lesser General Public License (LGPL) *)
|
|
|
32 |
(*------------------------------------------------------------------------*)
|
|
|
33 |
|
|
|
34 |
(* $Id: UnixCalls.def.m2cc,v 1.3 2018/06/08 07:46:25 mriedl Exp $ *)
|
|
|
35 |
|
|
|
36 |
PROCEDURE FileLength(VAR DateiLaenge : LONGCARD;
|
|
|
37 |
VAR Fehler : INTEGER;
|
|
|
38 |
VAR DateiName : ARRAY OF CHAR); (* Als letztes wg. HIGH *)
|
|
|
39 |
|
|
|
40 |
(*----------------------------------------------------------------*)
|
|
|
41 |
(* Kann von FileSystem.Length gerufen werden, um die L"ange *)
|
|
|
42 |
(* einer Datei zu ermitteln. *)
|
|
|
43 |
(* *)
|
|
|
44 |
(* Can be user by FileSystem.Lenght to get the length of a file *)
|
|
|
45 |
(* for internal use only. *)
|
|
|
46 |
(*----------------------------------------------------------------*)
|
|
|
47 |
|
|
|
48 |
PROCEDURE SetErrFlag(VAR Fehlerflag : ARRAY OF CHAR);
|
|
|
49 |
|
|
|
50 |
(*----------------------------------------------------------------*)
|
|
|
51 |
(* Ermitteln der letzten System-Fehlermeldung. Dies wird mittels *)
|
|
|
52 |
(* strerror(errno) und kopieren des gelieferten Zeigerinhalt in *)
|
|
|
53 |
(* Fehlerflag erreicht. *)
|
|
|
54 |
(* *)
|
|
|
55 |
(* Can be used to get the system error massage of the last error *)
|
|
|
56 |
(* errno is an integer variable which is set by system calls and *)
|
|
|
57 |
(* some library functions in the event of an error to indicate *)
|
|
|
58 |
(* what went wrong. "strerror" provides a pointer to a string *)
|
|
|
59 |
(* that describes the error code passed in the argument errnum. *)
|
|
|
60 |
(* The procedure copies that content to Fehlerflag via strcpy *)
|
|
|
61 |
(*----------------------------------------------------------------*)
|
|
|
62 |
|
|
|
63 |
END UnixCalls.
|