]> pd.if.org Git - pdclib.old/commitdiff
Not using typedef'ed types here for added insurance against incompabilities.
authorsolar <>
Thu, 20 Sep 2007 21:27:53 +0000 (21:27 +0000)
committersolar <>
Thu, 20 Sep 2007 21:27:53 +0000 (21:27 +0000)
platform/example/functions/_PDCLIB/close.c
platform/example/functions/_PDCLIB/open.c
platform/example/functions/_PDCLIB/read.c
platform/example/functions/_PDCLIB/write.c

index fd85f4c636986b630ebafb5440fe88308a946b26..f3475974adb3048ce3021ae2bb9f512344e72dd1 100644 (file)
@@ -20,7 +20,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-int _PDCLIB_close( _PDCLIB_fd_t fd )
+int _PDCLIB_close( int fd )
 {
     return close( fd );
 }
index 5feec6e828a89a3c8ccb0e2ff8c14492b2cdf22f..40d294f7de1150deabb11b2c601468ac330f58ee 100644 (file)
@@ -20,7 +20,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-_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 );
index db6418d58b451c68be84a4472694b4cfc5d84d71..2e35cea21fe7b79fe0d06e395581294527792e7f 100644 (file)
@@ -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 );
 }
 
index 24892348dd3720170168986dbda104bb213066a2..d2841f694195376ab08ab0419af59fa2a0370cc0 100644 (file)
@@ -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 );
 }