openblt

a hobby OS from the late 90s
git clone http://frotz.net/git/openblt.git
Log | Files | Refs | LICENSE

vfs.h (3980B)


      1 /* $Id: //depot/blt/include/blt/vfs.h#7 $
      2 **
      3 ** Copyright 1998-1999 Sidney Cammeresi
      4 ** All rights reserved.
      5 **
      6 ** Redistribution and use in source and binary forms, with or without
      7 ** modification, are permitted provided that the following conditions
      8 ** are met:
      9 ** 1. Redistributions of source code must retain the above copyright
     10 **    notice, this list of conditions, and the following disclaimer.
     11 ** 2. Redistributions in binary form must reproduce the above copyright
     12 **    notice, this list of conditions, and the following disclaimer in the
     13 **    documentation and/or other materials provided with the distribution.
     14 ** 3. The name of the author may not be used to endorse or promote products
     15 **    derived from this software without specific prior written permission.
     16 **
     17 ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     18 ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     19 ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     20 ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     21 ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     22 ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     23 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     24 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     25 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     26 ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     27 */
     28 
     29 #ifndef _BLT_VFS_H_
     30 #define _BLT_VFS_H_
     31 
     32 #include <blt/types.h>
     33 #include <blt/fdl.h>
     34 
     35 /* operations */
     36 #define VFS_OPENCONN                 1
     37 #define VFS_CLOSECONN                2
     38 #define VFS_SCROLL_AREA              19
     39 
     40 #define VFS_MOUNT                    3
     41 #define VFS_UNMOUNT                  4
     42 #define VFS_INITIALISE               5
     43 #define VFS_SYNC                     6
     44 #define VFS_RFSTAT                   7
     45 #define VFS_WFSTAT                   8
     46 
     47 #define VFS_CREATE                   9
     48 #define VFS_MKDIR                    10
     49 #define VFS_SYMLINK                  11
     50 #define VFS_LINK                     12
     51 #define VFS_RENAME                   13
     52 #define VFS_UNLINK                   14
     53 #define VFS_RMDIR                    15
     54 #define VFS_READLINK                 16
     55 
     56 #define VFS_OPENDIR                  17
     57 #define VFS_CLOSEDIR                 18
     58 
     59 #define VFS_OPEN                     21
     60 #define VFS_CLOSE                    22
     61 #define VFS_READ                     23
     62 #define VFS_WRITE                    24
     63 #define VFS_IOCTL                    25
     64 #define VFS_SETFLAGS                 26
     65 #define VFS_RSTAT                    27
     66 #define VFS_WSTAT                    28
     67 #define VFS_FSYNC                    29
     68 
     69 #define VFS_OPEN_ATTRDIR             30
     70 #define VFS_CLOSE_ATTRDIR            31
     71 #define VFS_REWIND_ATTRDIR           32
     72 #define VFS_READ_ATTRDIR             33
     73 #define VFS_READ_ATTR                34
     74 #define VFS_WRITE_ATTR               35
     75 #define VFS_REMOVE_ATTR              36
     76 #define VFS_RENAME_ATTR              37
     77 #define VFS_STAT_ATTR                38
     78 
     79 #define VFS_OPEN_INDEXDIR            39
     80 #define VFS_CLOSE_INDEXDIR           40
     81 #define VFS_REWIND_INDEXDIR          41
     82 #define VFS_READ_INDEXDIR            42
     83 #define VFS_READ_INDEX               43
     84 #define VFS_WRITE_INDEX              44
     85 #define VFS_REMOVE_INDEX             45
     86 #define VFS_RENAME_INDEX             46
     87 #define VFS_STAT_INDEX               47
     88 
     89 #define VFS_OPEN_QUERY               48
     90 #define VFS_CLOSE_QUERY              49
     91 #define VFS_READ_QUERY               50
     92 
     93 /* vfs result codes */
     94 #define VFS_OK                        1
     95 #define VFS_ERROR                     2
     96 #define VFS_MORE_DATA                 4
     97 
     98 typedef struct
     99 {
    100 	unsigned int cmd;
    101 	unsigned int data[6];
    102 } vfs_cmd_t;
    103 
    104 typedef struct
    105 {
    106 	unsigned int status, errno;
    107 	unsigned int data[6];
    108 } vfs_res_t;
    109 
    110 typedef struct
    111 {
    112 	char *buf;
    113 	int srv_fd, area_offset;
    114 	int offset, length, more;
    115 } vfs_fd;
    116 
    117 #endif
    118