Main Page | Modules | Data Structures | File List | Data Fields | Globals | Related Pages

syscalls.h

00001 /* 
00002  * This file is part of the dcload Dreamcast ethernet loader
00003  *
00004  * Copyright (C) 2001 Andrew Kieschnick <andrewk@austin.rr.com>
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00019  *
00020  */
00021 
00022 #ifndef __SYSCALLS_H__
00023 #define __SYSCALLS_H__
00024 
00025 #define CMD_EXIT     "DC00"
00026 #define CMD_FSTAT    "DC01"
00027 #define CMD_WRITE    "DD02"
00028 #define CMD_READ     "DC03"
00029 #define CMD_OPEN     "DC04"
00030 #define CMD_CLOSE    "DC05"
00031 #define CMD_CREAT    "DC06"
00032 #define CMD_LINK     "DC07"
00033 #define CMD_UNLINK   "DC08"
00034 #define CMD_CHDIR    "DC09"
00035 #define CMD_CHMOD    "DC10"
00036 #define CMD_LSEEK    "DC11"
00037 #define CMD_TIME     "DC12"
00038 #define CMD_STAT     "DC13"
00039 #define CMD_UTIME    "DC14"
00040 #define CMD_BAD      "DC15"
00041 #define CMD_OPENDIR  "DC16"
00042 #define CMD_CLOSEDIR "DC17"
00043 #define CMD_READDIR  "DC18"
00044 #define CMD_CDFSREAD "DC19"
00045 
00046 extern unsigned int syscall_retval;
00047 
00048 typedef struct {
00049   unsigned char id[4] __attribute__ ((packed));
00050   unsigned int value0 __attribute__ ((packed));
00051   unsigned int value1 __attribute__ ((packed));
00052   unsigned int value2 __attribute__ ((packed));
00053 } command_3int_t;
00054 
00055 typedef struct {
00056   unsigned char id[4] __attribute__ ((packed));
00057   unsigned int value0 __attribute__ ((packed));
00058   unsigned int value1 __attribute__ ((packed));
00059   unsigned char string[1] __attribute__ ((packed));
00060 } command_2int_string_t;
00061 
00062 typedef struct {
00063   unsigned char id[4] __attribute__ ((packed));
00064   unsigned int value0 __attribute__ ((packed));
00065 } command_int_t;
00066 
00067 typedef struct {
00068   unsigned char id[4] __attribute__ ((packed));
00069   unsigned int value0 __attribute__ ((packed));
00070   unsigned char string[1] __attribute__ ((packed));
00071 } command_int_string_t;
00072 
00073 typedef struct {
00074   unsigned char id[4] __attribute__ ((packed));
00075   unsigned char string[1] __attribute__ ((packed));
00076 } command_string_t;
00077 
00078 typedef struct {
00079   unsigned char id[4] __attribute__ ((packed));
00080   unsigned int value0 __attribute__ ((packed));
00081   unsigned int value1 __attribute__ ((packed));
00082   unsigned int value2 __attribute__ ((packed));
00083   unsigned char string[1] __attribute__ ((packed));
00084 } command_3int_string_t;
00085 
00086 void build_send_packet(int command_len);
00087 
00088 
00089 struct dcload_dirent {
00090   long            d_ino;  /* inode number */
00091   off_t           d_off;  /* offset to the next dirent */
00092   unsigned short  d_reclen;/* length of this record */
00093   unsigned char   d_type;         /* type of file */
00094   char            d_name[256];    /* filename */
00095 };
00096 
00097 typedef struct dcload_dirent dcload_dirent_t;
00098 
00099 #define DIR dcload_dirent_t
00100 
00101 /* dcload stat */
00102 
00103 struct  dcload_stat { 
00104   unsigned short st_dev;
00105   unsigned short st_ino;
00106   int st_mode;
00107   unsigned short st_nlink;
00108   unsigned short st_uid;
00109   unsigned short st_gid;
00110   unsigned short st_rdev;
00111   long st_size;
00112   long st_atime;
00113   long st_spare1;
00114   long st_mtime;
00115   long st_spare2;
00116   long st_ctime;
00117   long st_spare3;
00118   long st_blksize;
00119   long st_blocks;
00120   long st_spare4[2];
00121 };
00122 
00123 typedef struct dcload_stat dcload_stat_t;
00124 
00125 
00126 #endif

dcplaya documentation version 2.0 Generated on November 2004 by doxygen 1.3.6