CernVM-FS  2.11.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
libcvmfs_int.h
Go to the documentation of this file.
1 
13 #ifndef CVMFS_LIBCVMFS_INT_H_
14 #define CVMFS_LIBCVMFS_INT_H_
15 
16 #include <syslog.h>
17 #include <time.h>
18 #include <unistd.h>
19 
20 #include <string>
21 #include <vector>
22 
23 #include "backoff.h"
24 #include "catalog_mgr.h"
25 #include "file_chunk.h"
26 #include "interrupt.h"
27 #include "loader.h"
28 #include "lru.h"
29 #include "mountpoint.h"
30 #include "options.h"
31 
32 
33 class CacheManager;
34 namespace catalog {
35 class ClientCatalogManager;
36 }
37 namespace signature {
38 class SignatureManager;
39 }
40 namespace download {
41 class DownloadManager;
42 }
43 namespace perf {
44 class Statistics;
45 }
46 
47 namespace cvmfs {
48 extern pid_t pid_;
49 extern std::string *repository_name_;
50 extern bool foreground_;
51 class Fetcher;
52 }
53 
54 struct cvmfs_stat_t;
55 
56 
62  public:
63  static loader::Failures Initialize(OptionsManager *options_mgr);
64  static void CleanupInstance();
65  static LibGlobals* GetInstance();
66 
68  void set_options_mgr(OptionsManager *value) { options_mgr_ = value; }
69 
70  private:
71  LibGlobals();
72  ~LibGlobals();
74 
81 };
82 
83 
90  public:
91  static LibContext *Create(const std::string &fqrn,
92  OptionsManager *options_mgr);
93  ~LibContext();
94 
95  void EnableMultiThreaded();
96  int GetAttr(const char *c_path, struct stat *info);
97  int Readlink(const char *path, char *buf, size_t size);
98  int ListDirectory(const char *path,
99  char ***buf,
100  size_t *listlen,
101  size_t *buflen,
102  bool self_reference);
103  int ListDirectoryStat(const char *c_path,
104  cvmfs_stat_t **buf,
105  size_t *listlen,
106  size_t *buflen);
107 
108  int Open(const char *c_path);
109  int64_t Pread(int fd, void *buf, uint64_t size, uint64_t off);
110  int Close(int fd);
111 
112  int GetExtAttr(const char *c_path, struct cvmfs_attr *info);
113  int GetNestedCatalogAttr(const char *c_path, struct cvmfs_nc_attr *nc_attr);
114  int ListNestedCatalogs(const char *path, char ***buf, size_t *buflen);
115 
116  int Remount();
117  uint64_t GetRevision();
118 
120  void set_options_mgr(OptionsManager *value) { options_mgr_ = value; }
121 
122  private:
126  static const int kFdChunked = 1 << 30;
130  LibContext();
132 
133  void AppendStringToList(char const *str,
134  char ***buf,
135  size_t *listlen,
136  size_t *buflen);
137  void AppendStatToList(const cvmfs_stat_t st,
138  cvmfs_stat_t **buf,
139  size_t *listlen,
140  size_t *buflen);
141  bool GetDirentForPath(const PathString &path,
142  catalog::DirectoryEntry *dirent);
144  struct cvmfs_attr *attr);
145 
152 
158 };
159 
160 #endif // CVMFS_LIBCVMFS_INT_H_
uint64_t GetRevision()
static LibContext * Create(const std::string &fqrn, OptionsManager *options_mgr)
void EnableMultiThreaded()
static const int kFdChunked
Definition: libcvmfs_int.h:126
int GetNestedCatalogAttr(const char *c_path, struct cvmfs_nc_attr *nc_attr)
bool foreground_
Definition: loader.cc:133
int Close(int fd)
int GetAttr(const char *c_path, struct stat *info)
void set_options_mgr(OptionsManager *value)
Definition: libcvmfs_int.h:120
int GetExtAttr(const char *c_path, struct cvmfs_attr *info)
OptionsManager * options_mgr_
Definition: libcvmfs_int.h:150
bool GetDirentForPath(const PathString &path, catalog::DirectoryEntry *dirent)
static LibGlobals * instance_
Definition: libcvmfs_int.h:73
pid_t pid_
Definition: cvmfs.cc:148
int64_t Pread(int fd, void *buf, uint64_t size, uint64_t off)
static loader::Failures Initialize(OptionsManager *options_mgr)
Definition: libcvmfs_int.cc:94
int ListNestedCatalogs(const char *path, char ***buf, size_t *buflen)
MountPoint * mount_point_
Definition: libcvmfs_int.h:151
FileSystem * file_system()
Definition: libcvmfs_int.h:131
void AppendStatToList(const cvmfs_stat_t st, cvmfs_stat_t **buf, size_t *listlen, size_t *buflen)
Failures
Definition: loader.h:27
int ListDirectoryStat(const char *c_path, cvmfs_stat_t **buf, size_t *listlen, size_t *buflen)
static LibGlobals * GetInstance()
Definition: libcvmfs_int.cc:85
int Open(const char *c_path)
MountPoint * mount_point()
Definition: libcvmfs_int.h:119
int ListDirectory(const char *path, char ***buf, size_t *listlen, size_t *buflen, bool self_reference)
FileSystem * file_system_
Definition: libcvmfs_int.h:80
void AppendStringToList(char const *str, char ***buf, size_t *listlen, size_t *buflen)
int Readlink(const char *path, char *buf, size_t size)
InterruptCue default_interrupt_cue_
Definition: libcvmfs_int.h:157
void CvmfsAttrFromDirent(const catalog::DirectoryEntry dirent, struct cvmfs_attr *attr)
OptionsManager * options_mgr_
Definition: libcvmfs_int.h:79
static void size_t size
Definition: smalloc.h:47
void set_options_mgr(OptionsManager *value)
Definition: libcvmfs_int.h:68
static void CleanupInstance()
FileSystem * file_system()
Definition: libcvmfs_int.h:67
std::string * repository_name_
Definition: loader.cc:125