Support rastport clipping rectangle for layerless rastports
[tangerine.git] / rom / dos / duplock.c
blob9de2f22a5e4ee40d0f0ad6319d7600798a1ad369
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: dos.library function DupLock()
6 Lang: english
7 */
8 #include <proto/exec.h>
9 #include "dos_intern.h"
11 /*****************************************************************************
13 NAME */
14 #include <proto/dos.h>
16 AROS_LH1(BPTR, DupLock,
18 /* SYNOPSIS */
19 AROS_LHA(BPTR, lock, D1),
21 /* LOCATION */
22 struct DosLibrary *, DOSBase, 16, Dos)
24 /* FUNCTION
25 Clone a lock on a file or directory. This will only work on shared
26 locks.
28 INPUTS
29 lock - Old lock.
31 RESULT
32 The new lock or NULL in case of an error. IoErr() will give additional
33 information in that case.
35 NOTES
36 This function is identical to DupLockFromFH().
38 EXAMPLE
40 BUGS
42 SEE ALSO
44 INTERNALS
46 *****************************************************************************/
48 /*****************************************************************************
50 NAME
51 #include <clib/dos_protos.h>
53 AROS_LH1(BPTR, DupLockFromFH,
55 SYNOPSIS
56 AROS_LHA(BPTR, fh, D1),
58 LOCATION
59 struct DosLibrary *, DOSBase, 62, Dos)
61 FUNCTION
62 Try to get a lock on the object selected by the filehandle.
64 INPUTS
65 fh - filehandle.
67 RESULT
68 The new lock or 0 in case of an error. IoErr() will give additional
69 information in that case.
71 NOTES
72 This function is identical to DupLock().
74 EXAMPLE
76 BUGS
78 SEE ALSO
80 INTERNALS
82 *****************************************************************************/
83 /*AROS alias DupLockFromFH DupLock */
85 AROS_LIBFUNC_INIT
86 AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
88 BPTR old, new;
90 /* Use Lock() to clone the handle. cd to it first. */
91 old = CurrentDir(lock);
92 new=Lock("",SHARED_LOCK);
93 CurrentDir(old);
94 return new;
95 AROS_LIBFUNC_EXIT
96 } /* DupLock */