home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d1xx
/
d156
/
flex.lha
/
Flex
/
Flex2
/
gnu.lib.src
/
opendir.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-10-02
|
657b
|
30 lines
/*
* BSD/Unix expansion library for Amiga.
*
* opendir() -- system independent directory code
*/
#include "dir.h"
DIR *
opendir(dirname)
char *dirname;
{
register DIR *my_dir, *AllocMem(/* int, int */) ;
struct FileLock *Lock(/* char *, int */), *CurrentDir(/* struct FileLock * */) ;
if ((my_dir = AllocMem(sizeof(DIR), 0)) == NULL)
return NULL ;
if (((my_dir->d_lock = Lock(dirname, ACCESS_READ)) == NULL)
/* If we can't examine it */
|| !Examine(my_dir->d_lock, &(my_dir->d_info))
/* Or it's not a directory */
|| (my_dir->d_info.fib_DirEntryType < 0))
{
FreeMem(my_dir, sizeof(DIR)) ;
return NULL ;
}
return my_dir ;
}