static int generate_url(const char *buff, int size, char *url, int url_len) { char address[PATH_MAX], *ch; int len, ret = 0; len = shadow_file_read(PATH_HTTP_ADDRESS, address, sizeof(address), 0); if (len <= 0) { sheepfs_pr("Can't get address of http"); ret = -EINVAL; goto out; } /* remove last '\n' of address */ ch = strchr(address, '\n'); if (ch != NULL) *ch = '\0'; snprintf(url, url_len, "http://%s/v1%.*s", address, size, buff); out: return ret; }
int vdi_list_read(const char *path, char *buf, size_t size, off_t ignore) { return shadow_file_read(path, buf, size, 0); }
int http_address_read(const char *path, char *buf, size_t size, off_t ignore, struct fuse_file_info *fi) { return shadow_file_read(path, buf, size, 0); }
int node_info_read(const char *path, char *buf, size_t size, off_t ignore) { return shadow_file_read(path, buf, size, 0); }