Relicense Sortix to the ISC license.
I hereby relicense all my work on Sortix under the ISC license as below.
All Sortix contributions by other people are already under this license,
are not substantial enough to be copyrightable, or have been removed.
All imported code from other projects is compatible with this license.
All GPL licensed code from other projects had previously been removed.
Copyright 2011-2016 Jonas 'Sortie' Termansen and contributors.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2016-03-02 17:38:16 -05:00
|
|
|
/*
|
2018-07-14 16:34:48 -04:00
|
|
|
* Copyright (c) 2011, 2012, 2013, 2014, 2015, 2018 Jonas 'Sortie' Termansen.
|
Relicense Sortix to the ISC license.
I hereby relicense all my work on Sortix under the ISC license as below.
All Sortix contributions by other people are already under this license,
are not substantial enough to be copyrightable, or have been removed.
All imported code from other projects is compatible with this license.
All GPL licensed code from other projects had previously been removed.
Copyright 2011-2016 Jonas 'Sortie' Termansen and contributors.
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2016-03-02 17:38:16 -05:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, and distribute this software for any
|
|
|
|
* purpose with or without fee is hereby granted, provided that the above
|
|
|
|
* copyright notice and this permission notice appear in all copies.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
|
|
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
|
|
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
|
|
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
|
|
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*
|
|
|
|
* dirent.h
|
|
|
|
* Format of directory entries.
|
|
|
|
*/
|
Added readdir(3), closedir(3), rewinddir(3), dirfd(3), fdopendir(3),
opendir(3).
Also added non-standard dregister(3), dunregister(3), dclearerr(3),
derror(3), deof(3), dnewdir(3), dcloseall(3).
2012-01-14 14:54:02 -05:00
|
|
|
|
2022-07-07 19:09:15 -04:00
|
|
|
#ifndef _INCLUDE_DIRENT_H
|
|
|
|
#define _INCLUDE_DIRENT_H
|
Added readdir(3), closedir(3), rewinddir(3), dirfd(3), fdopendir(3),
opendir(3).
Also added non-standard dregister(3), dunregister(3), dclearerr(3),
derror(3), deof(3), dnewdir(3), dcloseall(3).
2012-01-14 14:54:02 -05:00
|
|
|
|
2013-10-13 07:04:27 -04:00
|
|
|
#include <sys/cdefs.h>
|
Added readdir(3), closedir(3), rewinddir(3), dirfd(3), fdopendir(3),
opendir(3).
Also added non-standard dregister(3), dunregister(3), dclearerr(3),
derror(3), deof(3), dnewdir(3), dcloseall(3).
2012-01-14 14:54:02 -05:00
|
|
|
|
2015-11-19 20:57:09 -05:00
|
|
|
#include <sortix/dirent.h>
|
2014-01-03 16:20:52 -05:00
|
|
|
|
2014-08-03 11:12:56 -04:00
|
|
|
#if defined(__is_sortix_libc)
|
|
|
|
#include <DIR.h>
|
|
|
|
#endif
|
|
|
|
|
2013-12-26 19:44:03 -05:00
|
|
|
#ifndef __DIR_defined
|
|
|
|
#define __DIR_defined
|
2015-05-10 17:40:54 -04:00
|
|
|
typedef struct __DIR DIR;
|
2013-12-26 19:44:03 -05:00
|
|
|
#endif
|
Added readdir(3), closedir(3), rewinddir(3), dirfd(3), fdopendir(3),
opendir(3).
Also added non-standard dregister(3), dunregister(3), dclearerr(3),
derror(3), deof(3), dnewdir(3), dcloseall(3).
2012-01-14 14:54:02 -05:00
|
|
|
|
2015-11-19 20:57:09 -05:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
2014-09-14 16:53:54 -04:00
|
|
|
#endif
|
2014-01-03 16:20:52 -05:00
|
|
|
|
2015-11-19 20:57:09 -05:00
|
|
|
int closedir(DIR*);
|
|
|
|
DIR* opendir(const char*);
|
|
|
|
struct dirent* readdir(DIR*);
|
|
|
|
void rewinddir(DIR*);
|
2014-09-14 16:53:54 -04:00
|
|
|
|
|
|
|
#if __USE_SORTIX || __USE_XOPEN
|
2014-01-03 12:20:15 -05:00
|
|
|
/* TODO: seekdir */
|
|
|
|
/* TODO: telldir */
|
2014-09-14 16:53:54 -04:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Functions from POSIX 1995. */
|
|
|
|
#if 199506L <= __USE_POSIX
|
|
|
|
/* readdir_r will not be implemented. */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Functions from POSIX 2008. */
|
|
|
|
#if __USE_SORTIX || 200809L <= __USE_POSIX
|
|
|
|
int alphasort(const struct dirent**, const struct dirent**);
|
2015-11-19 20:57:09 -05:00
|
|
|
int dirfd(DIR*);
|
|
|
|
DIR* fdopendir(int);
|
2014-09-14 16:53:54 -04:00
|
|
|
int scandir(const char*, struct dirent***, int (*)(const struct dirent*),
|
|
|
|
int (*)(const struct dirent**, const struct dirent**));
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Functions copied from elsewhere. */
|
|
|
|
#if __USE_SORTIX
|
2013-06-24 13:20:46 -04:00
|
|
|
int versionsort(const struct dirent**, const struct dirent**);
|
2014-09-14 16:53:54 -04:00
|
|
|
#endif
|
Added readdir(3), closedir(3), rewinddir(3), dirfd(3), fdopendir(3),
opendir(3).
Also added non-standard dregister(3), dunregister(3), dclearerr(3),
derror(3), deof(3), dnewdir(3), dcloseall(3).
2012-01-14 14:54:02 -05:00
|
|
|
|
2014-09-14 16:53:54 -04:00
|
|
|
/* Functions that are Sortix extensions. */
|
2014-04-02 15:35:20 -04:00
|
|
|
#if __USE_SORTIX
|
2014-09-14 16:53:54 -04:00
|
|
|
int alphasort_r(const struct dirent**, const struct dirent**, void*);
|
|
|
|
int dscandir_r(DIR*, struct dirent***,
|
|
|
|
int (*)(const struct dirent*, void*),
|
|
|
|
void*,
|
|
|
|
int (*)(const struct dirent**, const struct dirent**, void*),
|
|
|
|
void*);
|
|
|
|
int versionsort_r(const struct dirent**, const struct dirent**, void*);
|
Added readdir(3), closedir(3), rewinddir(3), dirfd(3), fdopendir(3),
opendir(3).
Also added non-standard dregister(3), dunregister(3), dclearerr(3),
derror(3), deof(3), dnewdir(3), dcloseall(3).
2012-01-14 14:54:02 -05:00
|
|
|
#endif
|
|
|
|
|
2015-05-13 12:11:02 -04:00
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif
|
Added readdir(3), closedir(3), rewinddir(3), dirfd(3), fdopendir(3),
opendir(3).
Also added non-standard dregister(3), dunregister(3), dclearerr(3),
derror(3), deof(3), dnewdir(3), dcloseall(3).
2012-01-14 14:54:02 -05:00
|
|
|
|
|
|
|
#endif
|