chirp_types.h

Go to the documentation of this file.
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 "chirp_protocol.h"
00016 
00017 #include "buffer.h"
00018 #include "int_sizes.h"
00019 
00020 #include <fcntl.h>
00021 #include <sys/types.h>
00022 
00023 #include <inttypes.h>
00024 #include <stdint.h>
00025 #include <time.h>
00026 
00034 struct chirp_stat {
00035         INT64_T cst_dev;        
00036         INT64_T cst_ino;        
00037         INT64_T cst_mode;       
00038         INT64_T cst_nlink;      
00039         INT64_T cst_uid;        
00040         INT64_T cst_gid;        
00041         INT64_T cst_rdev;       
00042         INT64_T cst_size;       
00043         INT64_T cst_blksize;    
00044         INT64_T cst_blocks;     
00045         INT64_T cst_atime;      
00046         INT64_T cst_mtime;      
00047         INT64_T cst_ctime;      
00048 };
00049 
00050 #define chirp_stat_encode(B, info) \
00051         do {\
00052                 buffer_putfstring(B, "%" PRId64, (info)->cst_dev);\
00053                 buffer_putfstring(B, " %" PRId64, (info)->cst_ino);\
00054                 buffer_putfstring(B, " %" PRId64, (info)->cst_mode);\
00055                 buffer_putfstring(B, " %" PRId64, (info)->cst_nlink);\
00056                 buffer_putfstring(B, " %" PRId64, (info)->cst_uid);\
00057                 buffer_putfstring(B, " %" PRId64, (info)->cst_gid);\
00058                 buffer_putfstring(B, " %" PRId64, (info)->cst_rdev);\
00059                 buffer_putfstring(B, " %" PRId64, (info)->cst_size);\
00060                 buffer_putfstring(B, " %" PRId64, (info)->cst_blksize);\
00061                 buffer_putfstring(B, " %" PRId64, (info)->cst_blocks);\
00062                 buffer_putfstring(B, " %" PRId64, (info)->cst_atime);\
00063                 buffer_putfstring(B, " %" PRId64, (info)->cst_mtime);\
00064                 buffer_putfstring(B, " %" PRId64, (info)->cst_ctime);\
00065         } while (0)
00066 
00067 
00072 struct chirp_statfs {
00073         INT64_T f_type;         
00074         INT64_T f_blocks;       
00075         INT64_T f_bavail;       
00076         INT64_T f_bsize;        
00077         INT64_T f_bfree;        
00078         INT64_T f_files;        
00079         INT64_T f_ffree;        
00080 };
00081 
00082 #define chirp_statfs_encode(B, info) \
00083         do {\
00084                 buffer_putfstring(B, "%" PRId64, (info)->f_type);\
00085                 buffer_putfstring(B, " %" PRId64, (info)->f_bsize);\
00086                 buffer_putfstring(B, " %" PRId64, (info)->f_blocks);\
00087                 buffer_putfstring(B, " %" PRId64, (info)->f_bfree);\
00088                 buffer_putfstring(B, " %" PRId64, (info)->f_bavail);\
00089                 buffer_putfstring(B, " %" PRId64, (info)->f_files);\
00090                 buffer_putfstring(B, " %" PRId64, (info)->f_ffree);\
00091         } while (0)
00092 
00095 struct chirp_dirent {
00096         char *name;                     
00097         int lstatus;            
00098         struct chirp_stat info;         
00099         struct chirp_dirent *next;
00100 };
00101 
00104 struct chirp_searchent {
00105         char path[CHIRP_PATH_MAX];                      
00106         struct chirp_stat info; 
00107         int errsource;
00108         int err;
00109 };
00110 
00113 struct chirp_searchstream {
00114         struct chirp_searchent entry;
00115         const char *current;
00116         buffer_t B;
00117 };
00118 
00119 #define CHIRP_SEARCH struct chirp_searchstream
00120 
00123 #define CHIRP_SEARCH_STOPATFIRST (1<<0)
00124 #define CHIRP_SEARCH_METADATA    (1<<1)
00125 #define CHIRP_SEARCH_INCLUDEROOT (1<<2)
00126 #define CHIRP_SEARCH_PERIOD      (1<<3)
00127 #define CHIRP_SEARCH_R_OK        (1<<4)
00128 #define CHIRP_SEARCH_W_OK        (1<<5)
00129 #define CHIRP_SEARCH_X_OK        (1<<6)
00130 
00133 #define CHIRP_SEARCH_ERR_OPEN    1
00134 #define CHIRP_SEARCH_ERR_READ    2
00135 #define CHIRP_SEARCH_ERR_CLOSE   3
00136 #define CHIRP_SEARCH_ERR_STAT    4
00137 
00140 #define CHIRP_SEARCH_DELIMITER   '|'
00141 #define CHIRP_SEARCH_DEPTH_MAX   200
00142 
00145 typedef enum {
00146         CHIRP_BULKIO_PREAD,  
00147         CHIRP_BULKIO_PWRITE, 
00148         CHIRP_BULKIO_SREAD,  
00149         CHIRP_BULKIO_SWRITE, 
00150         CHIRP_BULKIO_FSTAT,  
00151         CHIRP_BULKIO_FSYNC   
00152 } chirp_bulkio_t;
00153 
00158 struct chirp_bulkio {
00159         chirp_bulkio_t type;       
00160         struct chirp_file *file;   
00161         struct chirp_stat *info;   
00162         void *buffer;              
00163         INT64_T length;            
00164         INT64_T stride_length;     
00165         INT64_T stride_skip;       
00166         INT64_T offset;            
00167         INT64_T result;            
00168         INT64_T errnum;            
00169 };
00170 
00175 struct chirp_audit {
00176         char name[CHIRP_PATH_MAX];      
00177         INT64_T nfiles;                 
00178         INT64_T ndirs;                  
00179         INT64_T nbytes;                 
00180 };
00181 
00190 typedef void (*chirp_dir_t) (const char *path, void *arg);
00191 
00201 typedef void (*chirp_longdir_t) (const char *path, struct chirp_stat * info, void *arg);
00202 
00211 typedef void (*chirp_loc_t) (const char *location, void *arg);
00212 
00213 
00216 typedef int64_t chirp_jobid_t;
00217 #define PRICHIRP_JOBID_T  PRId64
00218 #define SCNCHIRP_JOBID_T  SCNd64
00219 
00222 #define CHIRP_DIGEST_MAX 128
00223 
00224 #endif
00225 
00226 /* vim: set noexpandtab tabstop=4: */

Generated on 14 Apr 2016 for cctools by  doxygen 1.4.7