fsd_defines.h

Go to the documentation of this file.
00001 
00014 #ifndef FSD_DEFINES_H_
00015 #define FSD_DEFINES_H_
00016 
00017 
00019 #define FSD_VERSION "MYSQL1.1"
00020 
00021 
00026 #define TEST                    "TS"
00027 #define CREATE                  "CF"
00028 #define MKDIR                   "MD"
00029 #define CLEAR_FILE              "CR"
00030 #define ADD_BLOCK               "AB"
00031 #define REMOVE_FILE     "RF"
00032 #define REMOVE_DIR              "RD"
00033 #define GET_BLOCK               "GB"
00034 #define LOOKUP                  "LU"
00035 #define READ_DIR                "RE"
00036 #define FILE_INFO               "FI"
00037 #define DIR_INFO                "DI"
00038 #define READ_INODE              "RI"
00039 #define CMD_OK                  "OK"
00040 #define CMD_ER                  "ER"
00041 #define REPLACE_BLOCK   "RB"
00042 #define MOVE_FILE               "MV"
00043 #define RENAME_FILE     "DN"
00044 #define RENAME_DIR              "DD"
00045 #define TRUNCATE_FILE   "TR"
00046 #define APPEND_FILE     "AP"
00047 
00054 #define UNKNOWN_COMMAND_NR              1000
00055 #define TEST_NR                                 1001
00056 #define CREATE_NR                               1002
00057 #define MKDIR_NR                                1003
00058 #define CLEAR_FILE_NR                   1004
00059 #define ADD_BLOCK_NR                    1005
00060 #define REMOVE_FILE_NR                  1006
00061 #define REMOVE_DIR_NR                   1007
00062 #define GET_BLOCK_NR                    1008
00063 #define LOOKUP_NR                               1009
00064 #define READ_DIR_NR                             1010
00065 #define CMD_OK_NR                               1011
00066 #define CMD_ER_NR                               1012
00067 #define DIR_INFO_NR                             1013
00068 #define FILE_INFO_NR                    1014
00069 #define READ_INODE_NR                   1015
00070 #define REPLACE_BLOCK_NR                1016
00071 #define MOVE_FILE_NR                    1017
00072 #define RENAME_FILE_NR                  1018
00073 #define TRUNCATE_FILE_NR                1019
00074 #define RENAME_DIR_NR                   1020
00075 
00082 #define MAX_NAME_LENGTH         64
00083 #define MAX_ID_LENGTH           11
00084 #define MAX_SIZE_LENGTH         11
00085 #define MAX_VERSION_LENGTH      10
00086 #define MAX_COMMAND_LENGTH      3
00087 #define MAX_PARAM_LENGTH        64
00088 #define MAX_BLOCK_LENGTH        4096
00089 
00090 /* max message length = "version command param data\n" */
00091 #define MAX_MESSAGE_LENGTH      5192
00092 #define MAX_QUERY_LENGTH        300
00093 
00100 #define CHAR_DEVICE_NAME        "fsc_dev"
00101 #define FSC_DEVICE_LOCATION "/dev/fsc_dev"
00102 
00112 #define DEFINITION_BASE                         100
00113 
00114 #define IS_FILE                                         (+ (DEFINITION_BASE + 6))
00115 #define IS_DIR                                          (+ (DEFINITION_BASE + 7))
00116 #define OK                                                      (+ (DEFINITION_BASE + 8))
00117         
00118 #define ENAME_NOT_EXISTS                        (- (DEFINITION_BASE + 11))
00119 #define EINODE_NOT_EXISTS                       (- (DEFINITION_BASE + 11))
00120 #define EDB_ERROR                                       (- (DEFINITION_BASE + 1)) 
00121 #define ENAME_EXISTS                            (- (DEFINITION_BASE + 3))
00122 #define EDIR_NOT_EXISTS                         (- (DEFINITION_BASE + 2))
00123 #define EDIR_IS_NOT_EMPTY                       (- (DEFINITION_BASE + 4))
00124 #define EBLOCK_NOT_EXISTS                       (- (DEFINITION_BASE + 5))
00125 #define EFILE_NOT_EXISTS                        (- (DEFINITION_BASE + 9))
00126 #define EDB_CONNECT_ERROR               (- (DEFINITION_BASE + 10))
00127 #define EFSC_DEVICE_OPEN_ERROR          (- (DEFINITION_BASE + 12))
00128 #define EFSC_DEVICE_NOT_OPEN            (- (DEFINITION_BASE + 13))
00129 #define EGENERAL_ERROR                          (- (DEFINITION_BASE + 14))
00130 #define EPROTOKOL_VERSION_ERROR         (- (DEFINITION_BASE + 15))
00131 #define EDIR_NAME_NOT_EXISTS            (- (DEFINITION_BASE + 16))
00132 #define EFILE_NAME_NOT_EXISTS           (- (DEFINITION_BASE + 17))
00133 #define EPARENT_NOT_EXISTS                      (- (DEFINITION_BASE + 18))
00134 
00141 struct read_dir_item {
00143         char type[2];
00145         char id[MAX_ID_LENGTH + 1];
00147         char name[MAX_NAME_LENGTH + 1];
00149         struct read_dir_item *next;
00150 };
00151 
00152 
00156 typedef struct read_dir_item rd_item;
00157 
00158 
00159 #endif
00160 

Generated on Mon May 28 13:33:08 2007 for MYSQLFS by  doxygen 1.5.0