From: Doni Pracner Date: Mon, 17 Feb 2014 18:44:17 +0000 (+0100) Subject: kod Zad3 skracen Lib32 na libdir - tj samo ono sto je potrebno X-Git-Tag: v14a~6 X-Git-Url: https://svarog.pmf.uns.ac.rs/gitweb/?a=commitdiff_plain;h=e148eb56fab9e6c7cb759a8fdc686202382f199f;p=os2skripta.git kod Zad3 skracen Lib32 na libdir - tj samo ono sto je potrebno --- diff --git a/skripta-os2.tex b/skripta-os2.tex index d1e6837..f74696f 100644 --- a/skripta-os2.tex +++ b/skripta-os2.tex @@ -387,42 +387,27 @@ Prva je testirana na Lubuntu 11.10 i 12.04 32bit, a druga je testirana na Kubuntu 11.10 i 12.10 64bit. \begin{codeblock} -DEFINITION MODULE FOR "C" Lib32; +DEFINITION MODULE FOR "C" libdir; + FROM SYSTEM IMPORT ADDRESS, BYTE; - EXPORT UNQUALIFIED opendir, readdir, closedir, stat, - PDir, DirEnt, PDirEnt, Stat, PStat, PInt; + + EXPORT UNQUALIFIED opendir, readdir, closedir, PDir, DirEnt, PDirEnt; \end{codeblock} -\begin{minipage}{0.5\textwidth} +\begin{minipage}{0.45\textwidth} \begin{codeblock} (* types for 32 bit *) TYPE PDir = ADDRESS; DirEnt = RECORD - ino: INTEGER; - off: INTEGER; - reclen: SHORTCARD; - type: BYTE; - name: ARRAY [0..255] OF CHAR; + ino: INTEGER; + off: INTEGER; + reclen: SHORTCARD; + type: BYTE; + name: ARRAY [0..255] OF CHAR; END; PDirEnt = POINTER TO DirEnt; - Stat = RECORD - dev: LONGINT; - ino: LONGINT; - mode: INTEGER; - nlink: LONGINT; - uid: INTEGER; - gid: INTEGER; - pad1: LONGINT; - rdev: INTEGER; - size: INTEGER; - blksize: INTEGER; - blocks: INTEGER; - atime: LONGINT; - mtime: LONGINT; - ctime: LONGINT; - END; - \end{codeblock} + \end{codeblock} \end{minipage} \begin{minipage}{0.45\textwidth} \begin{codeblock}[frame=single,frameround=tttt] @@ -430,40 +415,21 @@ DEFINITION MODULE FOR "C" Lib32; TYPE PDir = ADDRESS; DirEnt = RECORD - ino: LONGINT; - off: LONGINT; - reclen: SHORTCARD; - type: BYTE; - name: ARRAY [0..255] OF CHAR; + ino: LONGINT; + off: LONGINT; + reclen: SHORTCARD; + type: BYTE; + name: ARRAY [0..255] OF CHAR; END; PDirEnt = POINTER TO DirEnt; - Stat = RECORD - dev: LONGINT; - ino: LONGINT; - nlink: LONGINT; - mode: INTEGER; - uid: INTEGER; - gid: INTEGER; - pad1: INTEGER; - rdev: LONGINT; - size: LONGINT; - blksize: LONGINT; - blocks: LONGINT; - atime: LONGINT; - mtime: LONGINT; - ctime: LONGINT; - END; - \end{codeblock} +\end{codeblock} \end{minipage} \begin{codeblock} - PStat = POINTER TO Stat; - PInt = POINTER TO INTEGER; - PROCEDURE opendir(name: ARRAY OF CHAR): PDir; PROCEDURE readdir(dirp: PDir): PDirEnt; PROCEDURE closedir(dirp: PDir): [INTEGER]; - PROCEDURE stat(path: ARRAY OF CHAR; buf: PStat): [INTEGER]; -END Lib32. + +END libdir. \end{codeblock} \begin{codeblock} @@ -475,7 +441,7 @@ FROM NumberIO IMPORT WriteInt; FROM Args IMPORT Narg, GetArg; - FROM Lib32 IMPORT + FROM libdir IMPORT opendir, readdir, closedir, PDir, PDirEnt; FROM errno IMPORT geterrno;