src/lib/ppc405lib/ssx_io.c
/// Call the swrite() operation of a stream
Call the swrite() operation of a stream
Call the swrite () operation of a stream
ssize_t
swrite(FILE *stream, const void *buf, size_t count, size_t *written)
{
    ssize_t rc;
    size_t _written;
    if (SSX_ERROR_CHECK_API) {
        SSX_ERROR_IF((stream == 0), EBADF);
        SSX_IO_ERROR_IF(stream, (stream->swrite == 0), ENXIO);
        SSX_IO_ERROR_IF(stream, (buf == 0), EINVAL);
    }
    if (count == 0) {
        rc = 0;
        _written = 0;
    } else {
        rc = LOCK_FILE_OPERATION(stream,
                                 stream->swrite(stream, buf, count, &_written));
    }
    if (written != 0) {
        *written = _written;
    }
    return rc;
}
ssize_t swrite ( FILE * stream , const void * buf , size_t count , size_t * written ) { ssize_t rc ; size_t _written ; if ( SSX_ERROR_CHECK_API ) { SSX_ERROR_IF ( ( stream == 0 ) , EBADF ) ; SSX_IO_ERROR_IF ( stream , ( stream -> swrite == 0 ) , ENXIO ) ; SSX_IO_ERROR_IF ( stream , ( buf == 0 ) , EINVAL ) ; } if ( count == 0 ) { rc = 0 ; _written = 0 ; } else { rc = LOCK_FILE_OPERATION ( stream , stream -> swrite ( stream , buf , count , & _written ) ) ; } if ( written != 0 ) { * written = _written ; } return rc ; }
Call the swrite() operation of a stream
Call the swrite () operation of a stream