home *** CD-ROM | disk | FTP | other *** search
- /*
- * java.io.FileDescriptor.c
- *
- * Copyright (c) 1996 Systems Architecture Research Centre,
- * City University, London, UK.
- *
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * Written by Tim Wilkinson <tim@sarc.city.ac.uk>, February 1996.
- */
-
- #include <stdio.h>
- #include <assert.h>
- #include "java.io.FileDescriptor.h"
-
- /*
- * Initialise a file descriptor to the given file nr.
- */
- struct Hjava_io_FileDescriptor*
- java_io_FileDescriptor_initSystemFD(struct Hjava_io_FileDescriptor* this, long i)
- {
- unhand(this)->fd = i;
- return (this);
- }
-
- /*
- * Is this file descriptor valid ?
- */
- long /* bool */
- java_io_FileDescriptor_valid(struct Hjava_io_FileDescriptor* this)
- {
- if (unhand(this)->fd >= 0) {
- return (1);
- }
- else {
- return (0);
- }
- }
-