Moved SEEK_SET, SEEK_CUR, and SEEK_SET to <sortix/seek.h>.

This commit is contained in:
Jonas 'Sortie' Termansen 2012-02-24 17:34:50 +01:00
parent 5de83df6ec
commit cbdf54fcdd
7 changed files with 42 additions and 23 deletions

View File

@ -1,3 +0,0 @@
#ifndef SEEK_CUR
#define SEEK_CUR 1 /* Seek from current position. */
#endif

View File

@ -1,3 +0,0 @@
#ifndef SEEK_END
#define SEEK_END 2 /* Seek from end of file. */
#endif

View File

@ -1,3 +0,0 @@
#ifndef SEEK_SET
#define SEEK_SET 0 /* Seek from beginning of file. */
#endif

View File

@ -29,6 +29,7 @@
#include <features.h>
#include <sortix/fcntl.h>
#include <sortix/seek.h>
#include <sys/stat.h>
__BEGIN_DECLS
@ -39,10 +40,6 @@ __BEGIN_DECLS
/* TODO: F_RDLCK, F_UNLCK, F_WRLCK missing here */
@include(SEEK_SET.h)
@include(SEEK_CUR.h)
@include(SEEK_END.h)
/* TODO: AT_FDCWD missing here */
/* TODO: AT_EACCESS missing here */
/* TODO: AT_SYMLINK_NOFOLLOW missing here */

View File

@ -26,6 +26,7 @@
#define _STDIO_H 1
#include <features.h>
#include <sortix/seek.h>
__BEGIN_DECLS
@ -45,12 +46,6 @@ typedef struct _fpos_t fpos_t;
/* TODO: Implement L_tmpnam */
#endif
/* The possibilities for the third argument to `fseek'.
These values should not be changed. */
@include(SEEK_SET.h)
@include(SEEK_CUR.h)
@include(SEEK_END.h)
/* The possibilities for the third argument to `setvbuf'. */
#define _IOFBF 0 /* Fully buffered. */
#define _IOLBF 1 /* Line buffered. */

View File

@ -29,6 +29,7 @@
#define _UNISTD_H 1
#include <features.h>
#include <sortix/seek.h>
__BEGIN_DECLS
@ -51,10 +52,6 @@ __BEGIN_DECLS
/* TODO: _CS_* is missing here. */
@include(SEEK_CUR.h)
@include(SEEK_END.h)
@include(SEEK_SET.h)
/* TODO: F_* is missing here. */
/* TODO: _PC_* is missing here. */

39
sortix/seek.h Normal file
View File

@ -0,0 +1,39 @@
/*******************************************************************************
COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2012.
This file is part of Sortix.
Sortix is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
Sortix is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
Sortix. If not, see <http://www.gnu.org/licenses/>.
seek.h
Defines the SEEK_CUR, SEEK_SET, and SEEK_END values.
*******************************************************************************/
#ifndef SORTIX_SEEK_H
#define SORTIX_SEEK_H
#include <features.h>
__BEGIN_DECLS
#define SEEK_SET 0 /* Seek from beginning of file. */
#define SEEK_CUR 1 /* Seek from current position. */
#define SEEK_END 2 /* Seek from end of file. */
__END_DECLS
#endif