c-ipfs/include/ipfs/repo/fsrepo/fs_repo.h

47 lines
975 B
C
Raw Normal View History

2016-10-27 18:11:34 +00:00
/***
* handles a repo on the file system
*/
#ifndef fs_repo_h
#define fs_repo_h
#include <stdio.h>
#include "ipfs/repo/config/config.h"
2016-10-27 18:11:34 +00:00
/**
* a structure to hold the repo info
*/
struct FSRepo {
int closed;
char* path;
struct IOCloser* lock_file;
struct Config* config;
struct Datastore* data_store;
};
/**
* opens a fsrepo
* @param repo_path the path to the repo
2016-10-27 18:11:34 +00:00
* @param repo where to store the repo info
* @return 0 if there was a problem, otherwise 1
*/
int fs_repo_open(char* repo_path, struct FSRepo* repo);
2016-10-27 18:11:34 +00:00
/***
* checks to see if the repo is initialized
* @param repo_path the path to the repo
* @returns true(1) if it is initialized, otherwise false(0)
*/
int fs_repo_is_initialized(char* repo_path);
2016-10-27 18:11:34 +00:00
/**
* write the config file to disk
* @param path the path to the file
* @param config the config structure
* @returns true(1) on success
*/
int fs_repo_write_config_file(char* path, struct RepoConfig* config);
2016-10-27 18:11:34 +00:00
#endif /* fs_repo_h */