File: hostfs_dev.c

package info (click to toggle)
aranym 0.9.0final-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,232 kB
  • ctags: 14,742
  • sloc: cpp: 65,421; ansic: 28,283; sh: 3,209; asm: 3,064; makefile: 787; perl: 494; objc: 225; pascal: 37
file content (101 lines) | stat: -rw-r--r-- 2,929 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
 * $Header: /var/repos/aranym/atari/hostfs/hostfs_dev.c,v 1.3 2003/03/24 08:58:53 joy Exp $
 *
 * 2001-2003 STanda
 *
 * This is a part of the ARAnyM project sources.
 *
 * Originally taken from the STonX CVS repository.
 *
 */

/*
 * Copyright 1998, 1999, 2001 by Markus Kohm <Markus.Kohm@gmx.de>.
 *
 * See COPYING for details of legal notes.
 *
 * Modified by Chris Felsch <C.Felsch@gmx.de>.
 *
 * Filesystem device driver routines
 */

#include "natfeat.h"
#include "hostfs_dev.h"
#include "hostfs_nfapi.h"

long _cdecl ara_fs_dev_open     (FILEPTR *f);
long _cdecl ara_fs_dev_write    (FILEPTR *f, const char *buf, long bytes);
long _cdecl ara_fs_dev_read     (FILEPTR *f, char *buf, long bytes);
long _cdecl ara_fs_dev_lseek    (FILEPTR *f, long where, int whence);
long _cdecl ara_fs_dev_ioctl    (FILEPTR *f, int mode, void *buf);
long _cdecl ara_fs_dev_datime   (FILEPTR *f, ushort *timeptr, int rwflag);
long _cdecl ara_fs_dev_close    (FILEPTR *f, int pid);
long _cdecl ara_fs_dev_select   (FILEPTR *f, long proc, int mode);
void _cdecl ara_fs_dev_unselect (FILEPTR *f, long proc, int mode);



long _cdecl ara_fs_dev_open     (FILEPTR *f) {
	return nfCall((HOSTFS(DEV_OPEN), f));
}

long _cdecl ara_fs_dev_write    (FILEPTR *f, const char *buf, long bytes) {
	return nfCall((HOSTFS(DEV_WRITE), f, buf, bytes));
}

long _cdecl ara_fs_dev_read     (FILEPTR *f, char *buf, long bytes) {
	return nfCall((HOSTFS(DEV_READ), f, buf, bytes));
}

long _cdecl ara_fs_dev_lseek    (FILEPTR *f, long where, int whence) {
	return nfCall((HOSTFS(DEV_LSEEK), f, where, (long)whence));
}

long _cdecl ara_fs_dev_ioctl    (FILEPTR *f, int mode, void *buf) {
	return nfCall((HOSTFS(DEV_IOCTL), f, (long)mode, buf));
}

long _cdecl ara_fs_dev_datime   (FILEPTR *f, ushort *timeptr, int rwflag) {
	return nfCall((HOSTFS(DEV_DATIME), f, timeptr, (long)rwflag));
}

long _cdecl ara_fs_dev_close    (FILEPTR *f, int pid) {
	return nfCall((HOSTFS(DEV_CLOSE), f, (long)pid));
}

long _cdecl ara_fs_dev_select   (FILEPTR *f, long proc, int mode) {
	return nfCall((HOSTFS(DEV_SELECT), f, proc, (long)mode));
}

void _cdecl ara_fs_dev_unselect (FILEPTR *f, long proc, int mode) {
	nfCall((HOSTFS(DEV_UNSELECT), f, proc, (long)mode));
}



DEVDRV aranym_fs_devdrv =
{
    ara_fs_dev_open, ara_fs_dev_write, ara_fs_dev_read, ara_fs_dev_lseek,
    ara_fs_dev_ioctl, ara_fs_dev_datime, ara_fs_dev_close, ara_fs_dev_select,
    ara_fs_dev_unselect,
    NULL, NULL /* writeb, readb not needed */
};


/*
 * $Log: hostfs_dev.c,v $
 * Revision 1.3  2003/03/24 08:58:53  joy
 * aranymfs.xfs renamed to hostfs.xfs
 *
 * Revision 1.2  2003/03/01 11:57:37  joy
 * major HOSTFS NF API cleanup
 *
 * Revision 1.1  2002/12/10 20:47:21  standa
 * The HostFS (the host OS filesystem access via NatFeats) implementation.
 *
 * Revision 1.1  2002/05/22 07:53:22  standa
 * The PureC -> gcc conversion (see the CONFIGVARS).
 * MiNT .XFS sources added.
 *
 *
 */