work/bootstrap/gec17.c
EIF_INTEGER eif_file_info(rt_stat_buf *buf, int op) {
	switch (op) {
	case 0:	/* File permission mode */
		return (EIF_INTEGER)(buf->st_mode & ST_MODE);
	case 1:	/* Inode number */
		return (EIF_INTEGER)buf->st_ino;
	case 2:	/* Device inode resides on */
		return (EIF_INTEGER) buf->st_dev;
	case 3:	/* Device type */
		return (EIF_INTEGER) buf->st_rdev;
	case 4:	/* UID of file */
		return (EIF_INTEGER) buf->st_uid;
	case 5:	/* GID of file */
		return (EIF_INTEGER) buf->st_gid;
	case 6:	/* Size of file, in bytes */
			/* FIXME: This code should be upgraded to use 64-bit */
		return (EIF_INTEGER) buf->st_size;
	case 7:	/* Last modification time on file */
			/* FIXME: This code should be upgraded to use 64-bit */
		return (EIF_INTEGER) buf->st_mtime;
	case 8:	/* Last access made on file */
			/* FIXME: This code should be upgraded to use 64-bit */
		return (EIF_INTEGER) buf->st_atime;
	case 9:	/* Last status change */
			/* FIXME: This code should be upgraded to use 64-bit */
		return (EIF_INTEGER) buf->st_ctime;
	case 10: /* Number of links */
		return (EIF_INTEGER) buf->st_nlink;
	case 11: /* File type */
		return (EIF_INTEGER) (buf->st_mode & S_IFMT);
	case 12: /* Is file a directory */
		return (EIF_INTEGER) S_ISDIR(buf->st_mode);
	case 13: /* Is file a regular (plain) one */
		if (S_ISREG(buf->st_mode) || (0 == (buf->st_mode & S_IFMT)))
			return (EIF_INTEGER) EIF_TRUE;
		return (EIF_INTEGER) 0;
	case 14: /* Is file a device, ie character or block device. */
		return (S_ISCHR(buf->st_mode) || S_ISBLK(buf->st_mode));
	case 15: /* Is file a character device */
		return (EIF_INTEGER) S_ISCHR(buf->st_mode);
	case 16: /* Is file a block device */
		return (EIF_INTEGER) S_ISBLK(buf->st_mode);
	case 17: /* Is file a FIFO */
		return (EIF_INTEGER) S_ISFIFO(buf->st_mode);
	case 18: /* Is file a symbolic link */
		return (EIF_INTEGER) S_ISLNK(buf->st_mode);
	case 19: /* Is file a socket */
		return (EIF_INTEGER) S_ISSOCK(buf->st_mode);
	default:
		return (EIF_INTEGER)0;
    }
}
/*
 * Perform the field dereferencing from the appropriate stat structure,
 * which Eiffel cannot do directly.
 */
Perform the field dereferencing from the appropriate stat structure,
which Eiffel cannot do directly.
Perform the field dereferencing from the appropriate stat structure which Eiffel cannot do directly .
EIF_INTEGER eif_file_info(rt_stat_buf *buf, int op) {
	switch (op) {
	case 0:	
		return (EIF_INTEGER)(buf->st_mode & ST_MODE);
	case 1:	
		return (EIF_INTEGER)buf->st_ino;
	case 2:	
		return (EIF_INTEGER) buf->st_dev;
	case 3:	
		return (EIF_INTEGER) buf->st_rdev;
	case 4:	
		return (EIF_INTEGER) buf->st_uid;
	case 5:	
		return (EIF_INTEGER) buf->st_gid;
	case 6:	
		return (EIF_INTEGER) buf->st_size;
	case 7:	
		return (EIF_INTEGER) buf->st_mtime;
	case 8:	
		return (EIF_INTEGER) buf->st_atime;
	case 9:	
		return (EIF_INTEGER) buf->st_ctime;
	case 10: 
		return (EIF_INTEGER) buf->st_nlink;
	case 11: 
		return (EIF_INTEGER) (buf->st_mode & S_IFMT);
	case 12: 
		return (EIF_INTEGER) S_ISDIR(buf->st_mode);
	case 13: 
		if (S_ISREG(buf->st_mode) || (0 == (buf->st_mode & S_IFMT)))
			return (EIF_INTEGER) EIF_TRUE;
		return (EIF_INTEGER) 0;
	case 14: 
		return (S_ISCHR(buf->st_mode) || S_ISBLK(buf->st_mode));
	case 15: 
		return (EIF_INTEGER) S_ISCHR(buf->st_mode);
	case 16: 
		return (EIF_INTEGER) S_ISBLK(buf->st_mode);
	case 17: 
		return (EIF_INTEGER) S_ISFIFO(buf->st_mode);
	case 18: 
		return (EIF_INTEGER) S_ISLNK(buf->st_mode);
	case 19: 
		return (EIF_INTEGER) S_ISSOCK(buf->st_mode);
	default:
		return (EIF_INTEGER)0;
    }
}
EIF_INTEGER eif_file_info ( rt_stat_buf * buf , int op ) { switch ( op ) { case 0 : return ( EIF_INTEGER ) ( buf -> st_mode & ST_MODE ) ; case 1 : return ( EIF_INTEGER ) buf -> st_ino ; case 2 : return ( EIF_INTEGER ) buf -> st_dev ; case 3 : return ( EIF_INTEGER ) buf -> st_rdev ; case 4 : return ( EIF_INTEGER ) buf -> st_uid ; case 5 : return ( EIF_INTEGER ) buf -> st_gid ; case 6 : return ( EIF_INTEGER ) buf -> st_size ; case 7 : return ( EIF_INTEGER ) buf -> st_mtime ; case 8 : return ( EIF_INTEGER ) buf -> st_atime ; case 9 : return ( EIF_INTEGER ) buf -> st_ctime ; case 10 : return ( EIF_INTEGER ) buf -> st_nlink ; case 11 : return ( EIF_INTEGER ) ( buf -> st_mode & S_IFMT ) ; case 12 : return ( EIF_INTEGER ) S_ISDIR ( buf -> st_mode ) ; case 13 : if ( S_ISREG ( buf -> st_mode ) || ( 0 == ( buf -> st_mode & S_IFMT ) ) ) return ( EIF_INTEGER ) EIF_TRUE ; return ( EIF_INTEGER ) 0 ; case 14 : return ( S_ISCHR ( buf -> st_mode ) || S_ISBLK ( buf -> st_mode ) ) ; case 15 : return ( EIF_INTEGER ) S_ISCHR ( buf -> st_mode ) ; case 16 : return ( EIF_INTEGER ) S_ISBLK ( buf -> st_mode ) ; case 17 : return ( EIF_INTEGER ) S_ISFIFO ( buf -> st_mode ) ; case 18 : return ( EIF_INTEGER ) S_ISLNK ( buf -> st_mode ) ; case 19 : return ( EIF_INTEGER ) S_ISSOCK ( buf -> st_mode ) ; default : return ( EIF_INTEGER ) 0 ; } }
Perform the field dereferencing from the appropriate stat structure,
 which Eiffel cannot do directly.
Perform the field dereferencing from the appropriate stat structure which Eiffel cannot do directly .
/* File permission mode */ /* Inode number */ /* Device inode resides on */ /* Device type */ /* UID of file */ /* GID of file */ /* Size of file, in bytes */ /* FIXME: This code should be upgraded to use 64-bit */ /* Last modification time on file */ /* FIXME: This code should be upgraded to use 64-bit */ /* Last access made on file */ /* FIXME: This code should be upgraded to use 64-bit */ /* Last status change */ /* FIXME: This code should be upgraded to use 64-bit */ /* Number of links */ /* File type */ /* Is file a directory */ /* Is file a regular (plain) one */ /* Is file a device, ie character or block device. */ /* Is file a character device */ /* Is file a block device */ /* Is file a FIFO */ /* Is file a symbolic link */ /* Is file a socket */