cctools
chirp_reli.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3 Copyright (C) 2005- The University of Notre Dame
4 This software is distributed under the GNU General Public License.
5 See the file COPYING for details.
6 */
7 
32 #ifndef CHIRP_RELI_H
33 #define CHIRP_RELI_H
34 
35 #include "chirp_types.h"
36 
37 #include <sys/types.h>
38 #include <stdio.h>
39 
58 struct chirp_file *chirp_reli_open(const char *host, const char *path, INT64_T flags, INT64_T mode, time_t stoptime);
59 
68 INT64_T chirp_reli_close(struct chirp_file *file, time_t stoptime);
69 
80 INT64_T chirp_reli_pread(struct chirp_file *file, void *buffer, INT64_T length, INT64_T offset, time_t stoptime);
81 
93 INT64_T chirp_reli_pwrite(struct chirp_file *file, const void *buffer, INT64_T length, INT64_T offset, time_t stoptime);
94 
105 INT64_T chirp_reli_pread_unbuffered(struct chirp_file *file, void *buffer, INT64_T length, INT64_T offset, time_t stoptime);
106 
117 INT64_T chirp_reli_pwrite_unbuffered(struct chirp_file *file, const void *buffer, INT64_T length, INT64_T offset, time_t stoptime);
118 
133 INT64_T chirp_reli_sread(struct chirp_file *file, void *buffer, INT64_T length, INT64_T stride_length, INT64_T stride_skip, INT64_T offset, time_t stoptime);
134 
149 INT64_T chirp_reli_swrite(struct chirp_file *file, const void *buffer, INT64_T length, INT64_T stride_length, INT64_T stride_skip, INT64_T offset, time_t stoptime);
150 
159 INT64_T chirp_reli_fstat(struct chirp_file *file, struct chirp_stat *info, time_t stoptime);
160 
169 INT64_T chirp_reli_fstatfs(struct chirp_file *file, struct chirp_statfs *info, time_t stoptime);
170 
180 INT64_T chirp_reli_fchown(struct chirp_file *file, INT64_T uid, INT64_T gid, time_t stoptime);
181 
191 INT64_T chirp_reli_fchmod(struct chirp_file *file, INT64_T mode, time_t stoptime);
192 
200 INT64_T chirp_reli_ftruncate(struct chirp_file *file, INT64_T length, time_t stoptime);
201 
211 INT64_T chirp_reli_flush(struct chirp_file *file, time_t stoptime);
212 
213 INT64_T chirp_reli_fsync(struct chirp_file *file, time_t stoptime);
214 
227 INT64_T chirp_reli_getfile(const char *host, const char *path, FILE * stream, time_t stoptime);
228 
240 INT64_T chirp_reli_getfile_buffer(const char *host, const char *path, char **buffer, time_t stoptime);
241 
255 INT64_T chirp_reli_putfile(const char *host, const char *path, FILE * stream, INT64_T mode, INT64_T length, time_t stoptime);
256 
269 INT64_T chirp_reli_putfile_buffer(const char *host, const char *path, const char *buffer, INT64_T mode, INT64_T length, time_t stoptime);
270 
281 INT64_T chirp_reli_getlongdir(const char *host, const char *path, chirp_longdir_t callback, void *arg, time_t stoptime);
282 
294 INT64_T chirp_reli_getdir(const char *host, const char *path, chirp_dir_t callback, void *arg, time_t stoptime);
295 
318 struct chirp_dir *chirp_reli_opendir(const char *host, const char *path, time_t stoptime);
319 
330 struct chirp_dirent *chirp_reli_readdir(struct chirp_dir *dir);
331 
340 void chirp_reli_closedir(struct chirp_dir *dir);
341 
342 /* FIXME document */
343 INT64_T chirp_reli_ticket_create(const char *host, char name[CHIRP_PATH_MAX], unsigned bits, time_t stoptime);
344 INT64_T chirp_reli_ticket_register(const char *host, const char *name, const char *subject, time_t duration, time_t stoptime);
345 INT64_T chirp_reli_ticket_delete(const char *host, const char *name, time_t stoptime);
346 INT64_T chirp_reli_ticket_list(const char *host, const char *subject, char ***list, time_t stoptime);
347 INT64_T chirp_reli_ticket_get(const char *host, const char *name, char **subject, char **ticket, time_t * duration, char ***rights, time_t stoptime);
348 INT64_T chirp_reli_ticket_modify(const char *host, const char *name, const char *path, const char *aclmask, time_t stoptime);
349 
359 INT64_T chirp_reli_getacl(const char *host, const char *path, chirp_dir_t callback, void *arg, time_t stoptime);
360 
370 INT64_T chirp_reli_setacl(const char *host, const char *path, const char *subject, const char *rights, time_t stoptime);
371 
380 INT64_T chirp_reli_resetacl(const char *host, const char *path, const char *rights, time_t stoptime);
381 
390 INT64_T chirp_reli_locate(const char *host, const char *path, chirp_loc_t callback, void *arg, time_t stoptime);
391 
400 INT64_T chirp_reli_whoami(const char *host, char *subject, INT64_T length, time_t stoptime);
401 
412 INT64_T chirp_reli_whoareyou(const char *host, const char *rhost, char *subject, INT64_T length, time_t stoptime);
413 
423 INT64_T chirp_reli_mkfifo(const char *host, const char *path, time_t stoptime);
424 
432 INT64_T chirp_reli_unlink(const char *host, const char *path, time_t stoptime);
433 
442 INT64_T chirp_reli_rename(const char *host, const char *path, const char *newpath, time_t stoptime);
443 
452 INT64_T chirp_reli_link(const char *host, const char *path, const char *newpath, time_t stoptime);
453 
462 INT64_T chirp_reli_symlink(const char *host, const char *path, const char *newpath, time_t stoptime);
463 
473 INT64_T chirp_reli_readlink(const char *host, const char *path, char *buf, INT64_T length, time_t stoptime);
474 
475 
484 INT64_T chirp_reli_mkdir(const char *host, const char *path, INT64_T mode, time_t stoptime);
485 
494 INT64_T chirp_reli_mkdir_recursive(const char *host, const char *path, INT64_T mode, time_t stoptime);
495 
504 INT64_T chirp_reli_rmdir(const char *host, const char *path, time_t stoptime);
505 
516 INT64_T chirp_reli_rmall(const char *host, const char *path, time_t stoptime);
517 
527 INT64_T chirp_reli_stat(const char *host, const char *path, struct chirp_stat *info, time_t stoptime);
528 
539 INT64_T chirp_reli_lstat(const char *host, const char *path, struct chirp_stat *info, time_t stoptime);
540 
549 INT64_T chirp_reli_statfs(const char *host, const char *path, struct chirp_statfs *info, time_t stoptime);
550 
562 INT64_T chirp_reli_access(const char *host, const char *path, INT64_T flags, time_t stoptime);
563 
575 INT64_T chirp_reli_chmod(const char *host, const char *path, INT64_T mode, time_t stoptime);
576 
587 INT64_T chirp_reli_chown(const char *host, const char *path, INT64_T uid, INT64_T gid, time_t stoptime);
588 
599 INT64_T chirp_reli_lchown(const char *host, const char *path, INT64_T uid, INT64_T gid, time_t stoptime);
600 
609 INT64_T chirp_reli_truncate(const char *host, const char *path, INT64_T length, time_t stoptime);
610 
620 INT64_T chirp_reli_utime(const char *host, const char *path, time_t actime, time_t modtime, time_t stoptime);
621 
635 INT64_T chirp_reli_md5(const char *host, const char *path, unsigned char digest[16], time_t stoptime);
636 
647 INT64_T chirp_reli_setrep(const char *host, const char *path, int nreps, time_t stoptime );
648 
656 INT64_T chirp_reli_remote_debug(const char *host, const char *flag, time_t stoptime);
657 
671 INT64_T chirp_reli_localpath(const char *host, const char *path, char *localpath, int length, time_t stoptime);
672 
684 INT64_T chirp_reli_audit(const char *host, const char *path, struct chirp_audit **list, time_t stoptime);
685 
698 INT64_T chirp_reli_thirdput(const char *host, const char *path, const char *thirdhost, const char *thirdpath, time_t stoptime);
699 
711 INT64_T chirp_reli_mkalloc(const char *host, const char *path, INT64_T size, INT64_T mode, time_t stoptime);
712 
724 INT64_T chirp_reli_lsalloc(const char *host, const char *path, char *allocpath, INT64_T * total, INT64_T * inuse, time_t stoptime);
725 
736 INT64_T chirp_reli_bulkio(struct chirp_bulkio *list, int count, time_t stoptime);
737 
745 INT64_T chirp_reli_blocksize_get();
746 
754 void chirp_reli_blocksize_set(INT64_T bs);
755 
764 
765 #endif
INT64_T chirp_reli_mkalloc(const char *host, const char *path, INT64_T size, INT64_T mode, time_t stoptime)
Create a space allocation.
INT64_T chirp_reli_getfile(const char *host, const char *path, FILE *stream, time_t stoptime)
Get an entire file efficiently.
INT64_T chirp_reli_setrep(const char *host, const char *path, int nreps, time_t stoptime)
Set replication factor.
INT64_T chirp_reli_putfile_buffer(const char *host, const char *path, const char *buffer, INT64_T mode, INT64_T length, time_t stoptime)
Put an entire file efficiently from memory.
struct chirp_dir * chirp_reli_opendir(const char *host, const char *path, time_t stoptime)
Get an access control list.
INT64_T chirp_reli_swrite(struct chirp_file *file, const void *buffer, INT64_T length, INT64_T stride_length, INT64_T stride_skip, INT64_T offset, time_t stoptime)
Strided write to a file.
INT64_T chirp_reli_lsalloc(const char *host, const char *path, char *allocpath, INT64_T *total, INT64_T *inuse, time_t stoptime)
List a space allocation.
INT64_T chirp_reli_stat(const char *host, const char *path, struct chirp_stat *info, time_t stoptime)
Get file status.
INT64_T chirp_reli_symlink(const char *host, const char *path, const char *newpath, time_t stoptime)
Create a symbolic link.
INT64_T chirp_reli_getacl(const char *host, const char *path, chirp_dir_t callback, void *arg, time_t stoptime)
Get an access control list.
INT64_T chirp_reli_putfile(const char *host, const char *path, FILE *stream, INT64_T mode, INT64_T length, time_t stoptime)
Put an entire file efficiently.
INT64_T chirp_reli_access(const char *host, const char *path, INT64_T flags, time_t stoptime)
Check access permissions.
void(* chirp_loc_t)(const char *location, void *arg)
A callback function typedef used to display a file's location(s).
Definition: chirp_types.h:135
INT64_T chirp_reli_flush(struct chirp_file *file, time_t stoptime)
Flush any pending changes to a file.
void(* chirp_dir_t)(const char *path, void *arg)
A callback function typedef used to display a directory or access control list.
Definition: chirp_types.h:114
INT64_T chirp_reli_unlink(const char *host, const char *path, time_t stoptime)
Delete a file.
#define CHIRP_PATH_MAX
The maximum length of a full path in any Chirp operation.
Definition: chirp_protocol.h:20
INT64_T chirp_reli_mkfifo(const char *host, const char *path, time_t stoptime)
Create a named pipe (FIFO).
INT64_T chirp_reli_chmod(const char *host, const char *path, INT64_T mode, time_t stoptime)
Change mode bits.
INT64_T chirp_reli_thirdput(const char *host, const char *path, const char *thirdhost, const char *thirdpath, time_t stoptime)
Third party transfer.
INT64_T chirp_reli_ftruncate(struct chirp_file *file, INT64_T length, time_t stoptime)
Truncate an open file.
struct chirp_stat info
The properties of the directory entry.
Definition: chirp_types.h:63
void(* chirp_longdir_t)(const char *path, struct chirp_stat *info, void *arg)
A callback function typedef used to display a detailed directory.
Definition: chirp_types.h:125
INT64_T chirp_reli_remote_debug(const char *host, const char *flag, time_t stoptime)
Set the debug options on the remote server.
INT64_T chirp_reli_fchmod(struct chirp_file *file, INT64_T mode, time_t stoptime)
Change the mode bits of a file.
Describes a bulk I/O operation.
Definition: chirp_types.h:82
struct chirp_file * chirp_reli_open(const char *host, const char *path, INT64_T flags, INT64_T mode, time_t stoptime)
Creates or opens a file in preparation for I/O.
INT64_T chirp_reli_audit(const char *host, const char *path, struct chirp_audit **list, time_t stoptime)
Measure remote space consumption.
INT64_T chirp_reli_fchown(struct chirp_file *file, INT64_T uid, INT64_T gid, time_t stoptime)
Change the ownership of a file.
INT64_T chirp_reli_pwrite(struct chirp_file *file, const void *buffer, INT64_T length, INT64_T offset, time_t stoptime)
Write data to a file.
INT64_T chirp_reli_truncate(const char *host, const char *path, INT64_T length, time_t stoptime)
Truncate a file.
char * name
The name of the directory entry.
Definition: chirp_types.h:62
INT64_T chirp_reli_chown(const char *host, const char *path, INT64_T uid, INT64_T gid, time_t stoptime)
Change the ownership of a file.
INT64_T chirp_reli_fstatfs(struct chirp_file *file, struct chirp_statfs *info, time_t stoptime)
Get file system status.
Describes the properties of a file, much like the Unix stat structure.
Definition: chirp_types.h:29
INT64_T chirp_reli_getdir(const char *host, const char *path, chirp_dir_t callback, void *arg, time_t stoptime)
Get a simple directory listing.
INT64_T chirp_reli_localpath(const char *host, const char *path, char *localpath, int length, time_t stoptime)
Return the local path of a file.
INT64_T chirp_reli_utime(const char *host, const char *path, time_t actime, time_t modtime, time_t stoptime)
Change the modification times of a file.
INT64_T chirp_reli_rmdir(const char *host, const char *path, time_t stoptime)
Delete a directory if it is empty.
INT64_T chirp_reli_pread_unbuffered(struct chirp_file *file, void *buffer, INT64_T length, INT64_T offset, time_t stoptime)
Read data from a file without buffering.
void chirp_reli_closedir(struct chirp_dir *dir)
Close a directory.
INT64_T chirp_reli_mkdir_recursive(const char *host, const char *path, INT64_T mode, time_t stoptime)
Create a new directory recursively.
Descibes the space consumed by a single user on a Chirp server.
Definition: chirp_types.h:99
INT64_T chirp_reli_bulkio(struct chirp_bulkio *list, int count, time_t stoptime)
Perform multiple I/O operations in bulk.
INT64_T chirp_reli_fstat(struct chirp_file *file, struct chirp_stat *info, time_t stoptime)
Get file status.
INT64_T chirp_reli_mkdir(const char *host, const char *path, INT64_T mode, time_t stoptime)
Create a new directory.
struct chirp_dirent * chirp_reli_readdir(struct chirp_dir *dir)
Read one item from a directory.
INT64_T chirp_reli_sread(struct chirp_file *file, void *buffer, INT64_T length, INT64_T stride_length, INT64_T stride_skip, INT64_T offset, time_t stoptime)
Strided read from a file.
INT64_T chirp_reli_pwrite_unbuffered(struct chirp_file *file, const void *buffer, INT64_T length, INT64_T offset, time_t stoptime)
Write data to a file without buffering.
INT64_T chirp_reli_setacl(const char *host, const char *path, const char *subject, const char *rights, time_t stoptime)
Modify an access control list.
INT64_T chirp_reli_lchown(const char *host, const char *path, INT64_T uid, INT64_T gid, time_t stoptime)
Change the ownership of a file or link.
INT64_T chirp_reli_whoami(const char *host, char *subject, INT64_T length, time_t stoptime)
Return the caller's identity.
INT64_T chirp_reli_lstat(const char *host, const char *path, struct chirp_stat *info, time_t stoptime)
Get file or link status.
INT64_T chirp_reli_pread(struct chirp_file *file, void *buffer, INT64_T length, INT64_T offset, time_t stoptime)
Read data from a file.
INT64_T chirp_reli_getlongdir(const char *host, const char *path, chirp_longdir_t callback, void *arg, time_t stoptime)
Get a detailed directory listing.
INT64_T chirp_reli_link(const char *host, const char *path, const char *newpath, time_t stoptime)
Create a hard link.
void chirp_reli_cleanup_before_fork()
Prepare to fork in a parallel program.
INT64_T chirp_reli_resetacl(const char *host, const char *path, const char *rights, time_t stoptime)
Reset an access control list.
INT64_T chirp_reli_statfs(const char *host, const char *path, struct chirp_statfs *info, time_t stoptime)
Get filesystem status.
INT64_T chirp_reli_locate(const char *host, const char *path, chirp_loc_t callback, void *arg, time_t stoptime)
Identify the true location of a path.
INT64_T chirp_reli_rmall(const char *host, const char *path, time_t stoptime)
Delete a directory recursively.
INT64_T chirp_reli_getfile_buffer(const char *host, const char *path, char **buffer, time_t stoptime)
Get an entire file efficiently to memory.
INT64_T chirp_reli_whoareyou(const char *host, const char *rhost, char *subject, INT64_T length, time_t stoptime)
Return the server's identity against another server.
Describes the properties of a file system, much like the Unix statfs structure.
Definition: chirp_types.h:49
All of the structure and type definitions used by the Chirp API.
Definition: list.h:48
void chirp_reli_blocksize_set(INT64_T bs)
Set the buffer block size.
INT64_T chirp_reli_md5(const char *host, const char *path, unsigned char digest[16], time_t stoptime)
Checksum a remote file.
INT64_T chirp_reli_blocksize_get()
Return the current buffer block size.
INT64_T chirp_reli_close(struct chirp_file *file, time_t stoptime)
Closes an open file.
INT64_T chirp_reli_rename(const char *host, const char *path, const char *newpath, time_t stoptime)
Rename a file or directory.
Describes a directory entry returned by chirp_reli_readdir.
Definition: chirp_types.h:61
INT64_T chirp_reli_readlink(const char *host, const char *path, char *buf, INT64_T length, time_t stoptime)
Examine a symbolic link.