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_MAXENCODING  (4096)
00051 #define chirp_stat_encode(s, info) \
00052 do {\
00053         int n = 0;\
00054         n += sprintf((s)+n, "%" PRId64, (info)->cst_dev);\
00055         n += sprintf((s)+n, " %" PRId64, (info)->cst_ino);\
00056         n += sprintf((s)+n, " %" PRId64, (info)->cst_mode);\
00057         n += sprintf((s)+n, " %" PRId64, (info)->cst_nlink);\
00058         n += sprintf((s)+n, " %" PRId64, (info)->cst_uid);\
00059         n += sprintf((s)+n, " %" PRId64, (info)->cst_gid);\
00060         n += sprintf((s)+n, " %" PRId64, (info)->cst_rdev);\
00061         n += sprintf((s)+n, " %" PRId64, (info)->cst_size);\
00062         n += sprintf((s)+n, " %" PRId64, (info)->cst_blksize);\
00063         n += sprintf((s)+n, " %" PRId64, (info)->cst_blocks);\
00064         n += sprintf((s)+n, " %" PRId64, (info)->cst_atime);\
00065         n += sprintf((s)+n, " %" PRId64, (info)->cst_mtime);\
00066         n += sprintf((s)+n, " %" PRId64, (info)->cst_ctime);\
00067 } while (0)
00068 
00069 
00074 struct chirp_statfs {
00075         INT64_T f_type;         
00076         INT64_T f_blocks;       
00077         INT64_T f_bavail;       
00078         INT64_T f_bsize;        
00079         INT64_T f_bfree;        
00080         INT64_T f_files;        
00081         INT64_T f_ffree;        
00082 };
00083 
00084 #define CHIRP_STATFS_MAXENCODING  (4096)
00085 #define chirp_statfs_encode(s, info) \
00086 do {\
00087         int n = 0;\
00088         n += sprintf((s)+n, "%" PRId64, (info)->f_type);\
00089         n += sprintf((s)+n, " %" PRId64, (info)->f_bsize);\
00090         n += sprintf((s)+n, " %" PRId64, (info)->f_blocks);\
00091         n += sprintf((s)+n, " %" PRId64, (info)->f_bfree);\
00092         n += sprintf((s)+n, " %" PRId64, (info)->f_bavail);\
00093         n += sprintf((s)+n, " %" PRId64, (info)->f_files);\
00094         n += sprintf((s)+n, " %" PRId64, (info)->f_ffree);\
00095 } while (0)
00096 
00099 struct chirp_dirent {
00100         char *name;                     
00101         int lstatus;            
00102         struct chirp_stat info;         
00103         struct chirp_dirent *next;
00104 };
00105 
00108 struct chirp_searchent {
00109         char path[CHIRP_PATH_MAX];                      
00110         struct chirp_stat info; 
00111         int errsource;
00112         int err;
00113 };
00114 
00117 struct chirp_searchstream {
00118         struct chirp_searchent entry;
00119         const char *current;
00120         buffer_t B;
00121 };
00122 
00123 #define CHIRP_SEARCH struct chirp_searchstream
00124 
00127 #define CHIRP_SEARCH_STOPATFIRST (1<<0)
00128 #define CHIRP_SEARCH_METADATA    (1<<1)
00129 #define CHIRP_SEARCH_INCLUDEROOT (1<<2)
00130 #define CHIRP_SEARCH_PERIOD      (1<<3)
00131 #define CHIRP_SEARCH_R_OK        (1<<4)
00132 #define CHIRP_SEARCH_W_OK        (1<<5)
00133 #define CHIRP_SEARCH_X_OK        (1<<6)
00134 
00137 #define CHIRP_SEARCH_ERR_OPEN    1
00138 #define CHIRP_SEARCH_ERR_READ    2
00139 #define CHIRP_SEARCH_ERR_CLOSE   3
00140 #define CHIRP_SEARCH_ERR_STAT    4
00141 
00144 #define CHIRP_SEARCH_DELIMITER   '|'
00145 #define CHIRP_SEARCH_DEPTH_MAX   200
00146 
00149 typedef enum {
00150         CHIRP_BULKIO_PREAD,  
00151         CHIRP_BULKIO_PWRITE, 
00152         CHIRP_BULKIO_SREAD,  
00153         CHIRP_BULKIO_SWRITE, 
00154         CHIRP_BULKIO_FSTAT,  
00155         CHIRP_BULKIO_FSYNC   
00156 } chirp_bulkio_t;
00157 
00162 struct chirp_bulkio {
00163         chirp_bulkio_t type;       
00164         struct chirp_file *file;   
00165         struct chirp_stat *info;   
00166         void *buffer;              
00167         INT64_T length;            
00168         INT64_T stride_length;     
00169         INT64_T stride_skip;       
00170         INT64_T offset;            
00171         INT64_T result;            
00172         INT64_T errnum;            
00173 };
00174 
00179 struct chirp_audit {
00180         char name[CHIRP_PATH_MAX];      
00181         INT64_T nfiles;                 
00182         INT64_T ndirs;                  
00183         INT64_T nbytes;                 
00184 };
00185 
00194 typedef void (*chirp_dir_t) (const char *path, void *arg);
00195 
00205 typedef void (*chirp_longdir_t) (const char *path, struct chirp_stat * info, void *arg);
00206 
00215 typedef void (*chirp_loc_t) (const char *location, void *arg);
00216 
00217 
00220 typedef int64_t chirp_jobid_t;
00221 #define PRICHIRP_JOBID_T  PRId64
00222 #define SCNCHIRP_JOBID_T  SCNd64
00223 
00224 #endif
00225 
00226 /* vim: set noexpandtab tabstop=4: */

Generated on 18 Jun 2014 for cctools by  doxygen 1.6.1