use same location as .configured, etc, to store .files-touched
[AROS.git] / compiler / clib / __get_default_file.c
bloba371717108f52ebe53dd4c6e0a920714905fe9a1
1 /*
2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
3 $Id$
5 Function to get a dos.library file handle associated with given file
6 descriptor.
7 */
9 #include "__arosc_privdata.h"
10 #include "__fdesc.h"
12 /*****************************************************************************
14 NAME */
16 int __get_default_file (
18 /* SYNOPSIS */
19 int file_descriptor,
20 long * file_handle)
22 /* FUNCTION
23 Gets dos.library file handle associated with a given file descriptor.
25 INPUTS
26 file_descriptor - the File Descriptor you wish to obtain the associated
27 file handle for.
28 file_handle - Pointer to store the associated file handle.
30 RESULT
31 !=0 on error, 0 on success.
33 NOTES
34 This function is not a part of the ISO C standard, it comes from clib2
35 project and was implemented to make porting of abc-shell easier.
37 EXAMPLE
39 BUGS
41 SEE ALSO
43 INTERNALS
45 ******************************************************************************/
47 fdesc *fd;
49 if(
50 file_descriptor < 0 ||
51 (fd = __getfdesc(file_descriptor)) == NULL
52 ) return -1;
53 else
55 *(BPTR*)file_handle = (BPTR) fd->fcb->fh;
57 return 0;