00001 /* 00002 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin 00003 Copyright (C) 2005- The University of Notre Dame 00004 This software is distributed under the GNU General Public License. 00005 See the file COPYING for details. 00006 */ 00007 00012 #ifndef CHIRP_TYPES_H 00013 #define CHIRP_TYPES_H 00014 00015 #include "buffer.h" 00016 #include "int_sizes.h" 00017 #include "chirp_protocol.h" 00018 00019 #include <sys/types.h> 00020 #include <time.h> 00021 #include <fcntl.h> 00022 00030 struct chirp_stat { 00031 INT64_T cst_dev; 00032 INT64_T cst_ino; 00033 INT64_T cst_mode; 00034 INT64_T cst_nlink; 00035 INT64_T cst_uid; 00036 INT64_T cst_gid; 00037 INT64_T cst_rdev; 00038 INT64_T cst_size; 00039 INT64_T cst_blksize; 00040 INT64_T cst_blocks; 00041 INT64_T cst_atime; 00042 INT64_T cst_mtime; 00043 INT64_T cst_ctime; 00044 }; 00045 00050 struct chirp_statfs { 00051 INT64_T f_type; 00052 INT64_T f_blocks; 00053 INT64_T f_bavail; 00054 INT64_T f_bsize; 00055 INT64_T f_bfree; 00056 INT64_T f_files; 00057 INT64_T f_ffree; 00058 }; 00059 00062 struct chirp_dirent { 00063 char *name; 00064 struct chirp_stat info; 00065 struct chirp_dirent *next; 00066 }; 00067 00070 struct chirp_searchent { 00071 char path[CHIRP_PATH_MAX]; 00072 struct chirp_stat info; 00073 int errsource; 00074 int err; 00075 }; 00076 00079 struct chirp_searchstream { 00080 struct chirp_searchent entry; 00081 const char *current; 00082 buffer_t *buffer; 00083 }; 00084 00085 #define CHIRP_SEARCH struct chirp_searchstream 00086 00089 #define CHIRP_SEARCH_STOPATFIRST (1<<0) 00090 #define CHIRP_SEARCH_METADATA (1<<1) 00091 #define CHIRP_SEARCH_INCLUDEROOT (1<<2) 00092 #define CHIRP_SEARCH_PERIOD (1<<3) 00093 #define CHIRP_SEARCH_R_OK (1<<4) 00094 #define CHIRP_SEARCH_W_OK (1<<5) 00095 #define CHIRP_SEARCH_X_OK (1<<6) 00096 00099 #define CHIRP_SEARCH_ERR_OPEN 1 00100 #define CHIRP_SEARCH_ERR_READ 2 00101 #define CHIRP_SEARCH_ERR_CLOSE 3 00102 #define CHIRP_SEARCH_ERR_STAT 4 00103 00106 #define CHIRP_SEARCH_DELIMITER '|' 00107 #define CHIRP_SEARCH_DEPTH_MAX 200 00108 00111 typedef enum { 00112 CHIRP_BULKIO_PREAD, 00113 CHIRP_BULKIO_PWRITE, 00114 CHIRP_BULKIO_SREAD, 00115 CHIRP_BULKIO_SWRITE, 00116 CHIRP_BULKIO_FSTAT, 00117 CHIRP_BULKIO_FSYNC 00118 } chirp_bulkio_t; 00119 00124 struct chirp_bulkio { 00125 chirp_bulkio_t type; 00126 struct chirp_file *file; 00127 struct chirp_stat *info; 00128 void *buffer; 00129 INT64_T length; 00130 INT64_T stride_length; 00131 INT64_T stride_skip; 00132 INT64_T offset; 00133 INT64_T result; 00134 INT64_T errnum; 00135 }; 00136 00141 struct chirp_audit { 00142 char name[CHIRP_PATH_MAX]; 00143 INT64_T nfiles; 00144 INT64_T ndirs; 00145 INT64_T nbytes; 00146 }; 00147 00156 typedef void (*chirp_dir_t) (const char *path, void *arg); 00157 00167 typedef void (*chirp_longdir_t) (const char *path, struct chirp_stat * info, void *arg); 00168 00177 typedef void (*chirp_loc_t) (const char *location, void *arg); 00178 00179 #endif