irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

rodsPath.h
Go to the documentation of this file.
1 
3 #ifndef RODS_PATH_H__
4 #define RODS_PATH_H__
5 
6 #include "rodsDef.h"
7 #include "rods.h"
8 #include "getRodsEnv.h"
9 #include "rodsType.h"
10 #include "objStat.h"
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 #define STDOUT_FILE_NAME "-" /* pipe to stdout */
17 
18 typedef struct RodsPath {
22  uint objMode;
23  char inPath[MAX_NAME_LEN]; /* input from command line */
24  char outPath[MAX_NAME_LEN]; /* the path after parsing the inPath */
29 
30 /* This is the struct for a command line path input. Normally it contains
31  * one or more source input paths and 0 or 1 destination paths */
32 
33 typedef struct RodsPathInp {
34  int numSrc;
35  rodsPath_t *srcPath; /* pointr to an array of rodsPath_t */
37  rodsPath_t *targPath; /* This is a target path for a
38  * source/destination type command */
39  int resolved;
41 
42 /* definition for flag in parseCmdLinePath */
43 
44 #define ALLOW_NO_SRC_FLAG 0x1
45 
46 int
47 parseRodsPath( rodsPath_t *rodsPath, rodsEnv *myRodsEnv );
48 int
49 parseRodsPathStr( const char *inPath, rodsEnv *myRodsEnv, char *outPath );
50 int
51 addSrcInPath( rodsPathInp_t *rodsPathInp, const char *inPath );
52 int
53 parseLocalPath( rodsPath_t *rodsPath );
54 int
55 parseCmdLinePath( int argc, char **argv, int optInd, rodsEnv *myRodsEnv,
56  int srcFileType, int destFileType, int flag, rodsPathInp_t *rodsPathInp );
57 
58 int
59 getLastPathElement( char *inPath, char *lastElement );
60 
61 int
62 getFileType( rodsPath_t *rodsPath );
63 void
64 clearRodsPath( rodsPath_t *rodsPath );
65 
66 // Returns a new path with the following special characters escaped:
67 // - '\f'
68 //
69 // The character array returned is dynamically allocated. The caller is expected
70 // to deallocate this memory using "free".
71 char* escape_path(const char* _path);
72 
73 // Returns a non-zero value if the path ends with a trailing path separator ("/"), else zero.
74 int has_trailing_path_separator(const char* path);
75 
76 // Removes trailing slashes from path in-place.
77 void remove_trailing_path_separators(char* path);
78 
92 int has_prefix(const char* path, const char* prefix);
93 #ifdef __cplusplus
94 }
95 #endif
96 
97 #endif // RODS_PATH_H__
RodsPath::rodsObjStat
rodsObjStat_t * rodsObjStat
Definition: rodsPath.h:27
RodsPath::chksum
char chksum[64]
Definition: rodsPath.h:26
RodsPathInp::resolved
int resolved
Definition: rodsPath.h:39
objStat.h
RodsPathInp
Definition: rodsPath.h:33
has_trailing_path_separator
int has_trailing_path_separator(const char *path)
Definition: rodsPath.cpp:526
RodsPath::inPath
char inPath[(1024+64)]
Definition: rodsPath.h:23
RodsPath::objState
objStat_t objState
Definition: rodsPath.h:20
RodsPathInp::srcPath
rodsPath_t * srcPath
Definition: rodsPath.h:35
RodsPath::objType
objType_t objType
Definition: rodsPath.h:19
RodsPath::dataId
char dataId[64]
Definition: rodsPath.h:25
getLastPathElement
int getLastPathElement(char *inPath, char *lastElement)
Definition: rodsPath.cpp:444
RodsPathInp::targPath
rodsPath_t * targPath
Definition: rodsPath.h:37
RodsPathInp::destPath
rodsPath_t * destPath
Definition: rodsPath.h:36
objStat_t
objStat_t
Definition: rodsType.h:46
rodsType.h
remove_trailing_path_separators
void remove_trailing_path_separators(char *path)
Definition: rodsPath.cpp:536
rodsDef.h
MAX_NAME_LEN
#define MAX_NAME_LEN
Definition: rodsDef.h:61
parseCmdLinePath
int parseCmdLinePath(int argc, char **argv, int optInd, rodsEnv *myRodsEnv, int srcFileType, int destFileType, int flag, rodsPathInp_t *rodsPathInp)
Definition: rodsPath.cpp:356
escape_path
char * escape_path(const char *_path)
Definition: rodsPath.cpp:497
RodsPath::size
rodsLong_t size
Definition: rodsPath.h:21
rodsPathInp_t
struct RodsPathInp rodsPathInp_t
RodsPath::outPath
char outPath[(1024+64)]
Definition: rodsPath.h:24
parseLocalPath
int parseLocalPath(rodsPath_t *rodsPath)
Definition: rodsPath.cpp:215
parseRodsPathStr
int parseRodsPathStr(const char *inPath, rodsEnv *myRodsEnv, char *outPath)
Definition: rodsPath.cpp:29
RodsPath::objMode
uint objMode
Definition: rodsPath.h:22
parseRodsPath
int parseRodsPath(rodsPath_t *rodsPath, rodsEnv *myRodsEnv)
Definition: rodsPath.cpp:54
RodsPathInp::numSrc
int numSrc
Definition: rodsPath.h:34
has_prefix
int has_prefix(const char *path, const char *prefix)
Definition: rodsPath.cpp:561
rodsObjStat
Definition: objStat.h:8
clearRodsPath
void clearRodsPath(rodsPath_t *rodsPath)
Definition: rodsPath.cpp:481
RodsPath
Definition: rodsPath.h:18
rodsEnv
Definition: getRodsEnv.h:8
NAME_LEN
#define NAME_LEN
Definition: rodsDef.h:55
getFileType
int getFileType(rodsPath_t *rodsPath)
Definition: rodsPath.cpp:232
addSrcInPath
int addSrcInPath(rodsPathInp_t *rodsPathInp, const char *inPath)
Definition: rodsPath.cpp:261
rods.h
rodsPath_t
struct RodsPath rodsPath_t
rodsLong_t
long long rodsLong_t
Definition: rodsType.h:32
objType_t
objType_t
Definition: rodsType.h:36
getRodsEnv.h