revert between 56095 -> 55830 in arch
[AROS.git] / rom / dos / examine.c
blob01e32d88972f7555e28c29304674dfa4cd8eaf0a
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: dos.library function Examine().
6 Lang: English
7 */
9 #include <aros/debug.h>
10 #include <exec/memory.h>
11 #include <proto/exec.h>
12 #include "dos_intern.h"
14 /*****************************************************************************
16 NAME */
17 #include <proto/dos.h>
19 AROS_LH2(LONG, Examine,
21 /* SYNOPSIS */
22 AROS_LHA(BPTR, lock, D1),
23 AROS_LHA(struct FileInfoBlock *, fib, D2),
25 /* LOCATION */
26 struct DosLibrary *, DOSBase, 17, Dos)
28 /* FUNCTION
29 Fill in a FileInfoBlock structure concerning a file or directory
30 associated with a particular lock.
32 INPUTS
33 lock - lock to examine
34 fib - FileInfoBlock where the result of the examination is stored
36 RESULT
37 A boolean telling whether the operation was successful or not.
39 NOTES
40 FileInfoBlocks should be allocated with AllocDosObject(). You may make
41 a copy of the FileInfoBlock but, however, this copy may NOT be passed
42 to ExNext()!
44 EXAMPLE
46 BUGS
48 SEE ALSO
49 Lock(), UnLock(), ExNext(), AllocDosObject(), ExAll(), <dos/dos.h>
51 INTERNALS
53 *****************************************************************************/
56 AROS_LIBFUNC_INIT
58 struct FileLock *fl = BADDR(lock);
59 LONG ret;
61 ASSERT_VALID_PTR_OR_NULL(BADDR(lock));
62 ASSERT_VALID_FILELOCK(lock);
64 D(bug("[Examine] lock=%x fib=%x\n", fl, fib));
65 ret = dopacket2(DOSBase, NULL, fl ? fl->fl_Task : GetFileSysTask(), ACTION_EXAMINE_OBJECT, lock, MKBADDR(fib));
66 if (ret) {
67 fixfib(fib);
68 D(bug("[Examine] '%s'\n", fib->fib_FileName));
70 return ret;
72 AROS_LIBFUNC_EXIT
73 } /* Examine */