| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
#ifndef LLVM_FUZZER_IO_H |
| 13 |
#define LLVM_FUZZER_IO_H |
| 14 |
|
| 15 |
#include "FuzzerDefs.h" |
| 16 |
|
| 17 |
namespace fuzzer { |
| 18 |
|
| 19 |
long GetEpoch(const std::string &Path); |
| 20 |
|
| 21 |
Unit FileToVector(const std::string &Path, size_t MaxSize = 0, |
| 22 |
bool ExitOnError = true); |
| 23 |
|
| 24 |
std::string FileToString(const std::string &Path); |
| 25 |
|
| 26 |
void CopyFileToErr(const std::string &Path); |
| 27 |
|
| 28 |
void WriteToFile(const Unit &U, const std::string &Path); |
| 29 |
|
| 30 |
void ReadDirToVectorOfUnits(const char *Path, std::vector<Unit> *V, |
| 31 |
long *Epoch, size_t MaxSize, bool ExitOnError); |
| 32 |
|
| 33 |
|
| 34 |
std::string DirPlusFile(const std::string &DirPath, |
| 35 |
const std::string &FileName); |
| 36 |
|
| 37 |
|
| 38 |
std::string DirName(const std::string &FileName); |
| 39 |
|
| 40 |
void DupAndCloseStderr(); |
| 41 |
|
| 42 |
void CloseStdout(); |
| 43 |
|
| 44 |
void Printf(const char *Fmt, ...); |
| 45 |
|
| 46 |
|
| 47 |
bool IsFile(const std::string &Path); |
| 48 |
|
| 49 |
void ListFilesInDirRecursive(const std::string &Dir, long *Epoch, |
| 50 |
std::vector<std::string> *V, bool TopDir); |
| 51 |
|
| 52 |
char GetSeparator(); |
| 53 |
|
| 54 |
FILE* OpenFile(int Fd, const char *Mode); |
| 55 |
|
| 56 |
int CloseFile(int Fd); |
| 57 |
|
| 58 |
int DuplicateFile(int Fd); |
| 59 |
|
| 60 |
void RemoveFile(const std::string &Path); |
| 61 |
|
| 62 |
} |
| 63 |
|
| 64 |
#endif |