2016-12-12 11:27:06 +00:00
|
|
|
#ifndef __IPFS_IMPORTER_IMPORTER_H__
|
|
|
|
#define __IPFS_IMPORTER_IMPORTER_H__
|
|
|
|
|
2016-12-19 14:03:28 +00:00
|
|
|
#include "ipfs/merkledag/node.h"
|
2016-12-14 17:07:43 +00:00
|
|
|
#include "ipfs/repo/fsrepo/fs_repo.h"
|
2016-12-14 11:25:09 +00:00
|
|
|
|
2016-12-12 11:27:06 +00:00
|
|
|
/**
|
|
|
|
* Creates a node based on an incoming file
|
2017-01-02 04:48:09 +00:00
|
|
|
* @param root the root directory
|
|
|
|
* @param file_name the file to import (could contain a directory)
|
2016-12-12 11:27:06 +00:00
|
|
|
* @param node the root node (could have links to others)
|
2017-01-02 04:48:09 +00:00
|
|
|
* @param fs_repo the repo to use
|
|
|
|
* @param bytes_written the number of bytes written to disk
|
|
|
|
* @param recursive true(1) if you want to include files and directories
|
2016-12-12 11:27:06 +00:00
|
|
|
* @returns true(1) on success
|
|
|
|
*/
|
2017-01-02 04:48:09 +00:00
|
|
|
int ipfs_import_file(const char* root, const char* fileName, struct Node** node, struct FSRepo* fs_repo, size_t* bytes_written, int recursive);
|
2016-12-12 11:27:06 +00:00
|
|
|
|
2016-12-21 13:08:44 +00:00
|
|
|
/**
|
|
|
|
* called from the command line
|
|
|
|
* @param argc the number of arguments
|
|
|
|
* @param argv the arguments
|
|
|
|
*/
|
2016-12-28 02:39:58 +00:00
|
|
|
int ipfs_import_files(int argc, char** argv);
|
2016-12-21 13:08:44 +00:00
|
|
|
|
2016-12-12 11:27:06 +00:00
|
|
|
#endif /* INCLUDE_IPFS_IMPORTER_IMPORTER_H_ */
|