--- a
+++ b/UnixCalls.def.m2cc
@@ -0,0 +1,63 @@
+#ifdef __XDS__
+DEFINITION MODULE ["C"] UnixCalls; (* XDS *)
+#endif
+#ifdef __GM2__
+DEFINITION MODULE FOR "C" UnixCalls; (* GNU M2 *)
+#endif
+#ifdef __MOCKA__
+FOREIGN MODULE UnixCalls; (* Mocka *)
+#endif
+
+ (*========================================================================*)
+ (* WICHTIG: BITTE NUR DIE DATEI UnixCalls.def.m2cc EDITIEREN !!! *)
+ (*========================================================================*)
+ (* Aufrufe von UNIX Prozeduren mit "C" Huelle *)
+ (* Call to UNIX procedures with a "C" wrapper *)
+ (* *)
+ (* Es sind 3 Versionen enthalten die mit *)
+ (* *)
+ (* m2cc -D __{Parameter}__ < UnixCalls.def.m2cc > UnixCalls.def *)
+ (* *)
+ (* mit Parameter = {XDS|GM2} erzeugt werden koennen. *)
+ (* *)
+ (* XDS : Parameter werden fuer den XDS Modula-2 Compilter gesetzt *)
+ (* GM2 : Parameter werden fuer den GNU Modula-2 Compilter gesetzt *)
+ (* MOCKA : Parameter werden fuer den MOCKA Compilter gesetzt *)
+ (* *)
+ (* There are three version contained for XDS,GM2 and the Mocka compiler, *)
+ (* they can obtained with the m2cc command line shown above *)
+ (*------------------------------------------------------------------------*)
+ (* Implementation : Michael Riedl *)
+ (* Licence : GNU Lesser General Public License (LGPL) *)
+ (*------------------------------------------------------------------------*)
+
+ (* $Id: UnixCalls.def.m2cc,v 1.3 2018/06/08 07:46:25 mriedl Exp $ *)
+
+PROCEDURE FileLength(VAR DateiLaenge : LONGCARD;
+ VAR Fehler : INTEGER;
+ VAR DateiName : ARRAY OF CHAR); (* Als letztes wg. HIGH *)
+
+ (*----------------------------------------------------------------*)
+ (* Kann von FileSystem.Length gerufen werden, um die L"ange *)
+ (* einer Datei zu ermitteln. *)
+ (* *)
+ (* Can be user by FileSystem.Lenght to get the length of a file *)
+ (* for internal use only. *)
+ (*----------------------------------------------------------------*)
+
+PROCEDURE SetErrFlag(VAR Fehlerflag : ARRAY OF CHAR);
+
+ (*----------------------------------------------------------------*)
+ (* Ermitteln der letzten System-Fehlermeldung. Dies wird mittels *)
+ (* strerror(errno) und kopieren des gelieferten Zeigerinhalt in *)
+ (* Fehlerflag erreicht. *)
+ (* *)
+ (* Can be used to get the system error massage of the last error *)
+ (* errno is an integer variable which is set by system calls and *)
+ (* some library functions in the event of an error to indicate *)
+ (* what went wrong. "strerror" provides a pointer to a string *)
+ (* that describes the error code passed in the argument errnum. *)
+ (* The procedure copies that content to Fehlerflag via strcpy *)
+ (*----------------------------------------------------------------*)
+
+END UnixCalls.