From 417f74b5fa364ce12c0071bfe20886c2d64027ec Mon Sep 17 00:00:00 2001 From: solar <> Date: Thu, 20 Sep 2007 21:27:53 +0000 Subject: [PATCH] Not using typedef'ed types here for added insurance against incompabilities. --- platform/example/functions/_PDCLIB/close.c | 2 +- platform/example/functions/_PDCLIB/open.c | 4 ++-- platform/example/functions/_PDCLIB/read.c | 3 ++- platform/example/functions/_PDCLIB/write.c | 3 ++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/platform/example/functions/_PDCLIB/close.c b/platform/example/functions/_PDCLIB/close.c index fd85f4c..f347597 100644 --- a/platform/example/functions/_PDCLIB/close.c +++ b/platform/example/functions/_PDCLIB/close.c @@ -20,7 +20,7 @@ #include #include -int _PDCLIB_close( _PDCLIB_fd_t fd ) +int _PDCLIB_close( int fd ) { return close( fd ); } diff --git a/platform/example/functions/_PDCLIB/open.c b/platform/example/functions/_PDCLIB/open.c index 5feec6e..40d294f 100644 --- a/platform/example/functions/_PDCLIB/open.c +++ b/platform/example/functions/_PDCLIB/open.c @@ -20,7 +20,7 @@ #include #include -_PDCLIB_fd_t _PDCLIB_open( char const * const filename, unsigned int mode ) +int _PDCLIB_open( char const * const filename, unsigned int mode ) { /* FIXME: THIS IS NOT TO BE USED OUT-OF-THE-BOX. It is a proof-of-concept implementation. E.g. a stream may only be fully @@ -78,7 +78,7 @@ int main( void ) /* This testdriver assumes POSIX, i.e. _PDCLIB_fd_t being int and being incremented by one on each successful open. */ - _PDCLIB_fd_t fh; + int fh; char buffer[ 10 ]; /* Trying to read non-existent file. */ TESTCASE( _PDCLIB_open( "testfile", _PDCLIB_FREAD ) == _PDCLIB_NOHANDLE ); diff --git a/platform/example/functions/_PDCLIB/read.c b/platform/example/functions/_PDCLIB/read.c index db6418d..2e35cea 100644 --- a/platform/example/functions/_PDCLIB/read.c +++ b/platform/example/functions/_PDCLIB/read.c @@ -12,8 +12,9 @@ int read(int, void *, unsigned int); -_PDCLIB_size_t _PDCLIB_read( _PDCLIB_fd_t fd, char * buffer, _PDCLIB_size_t n ) +_PDCLIB_size_t _PDCLIB_read( int fd, char * buffer, _PDCLIB_size_t n ) { + /* FIXME: Might return value < n, might return -1 on error */ return read( fd, buffer, n ); } diff --git a/platform/example/functions/_PDCLIB/write.c b/platform/example/functions/_PDCLIB/write.c index 2489234..d2841f6 100644 --- a/platform/example/functions/_PDCLIB/write.c +++ b/platform/example/functions/_PDCLIB/write.c @@ -12,8 +12,9 @@ int write(int, const void *, unsigned int); -_PDCLIB_size_t _PDCLIB_write( _PDCLIB_fd_t fd, char const * buffer, _PDCLIB_size_t n ) +_PDCLIB_size_t _PDCLIB_write( int fd, char const * buffer, _PDCLIB_size_t n ) { + /* FIXME: Might return value < n, might return -1 on error */ return write( fd, buffer, n ); } -- 2.40.0