Changeset View
Changeset View
Standalone View
Standalone View
src/util.h
Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | inline std::string _(const char *psz) { | ||||
boost::optional<std::string> rv = translationInterface.Translate(psz); | boost::optional<std::string> rv = translationInterface.Translate(psz); | ||||
return rv ? (*rv) : psz; | return rv ? (*rv) : psz; | ||||
} | } | ||||
void SetupEnvironment(); | void SetupEnvironment(); | ||||
bool SetupNetworking(); | bool SetupNetworking(); | ||||
template <typename... Args> bool error(const char *fmt, const Args &... args) { | template <typename... Args> bool error(const char *fmt, const Args &... args) { | ||||
LogPrintStr("ERROR: " + tfm::format(fmt, args...) + "\n"); | LogPrintf("ERROR: " + tfm::format(fmt, args...) + "\n"); | ||||
return false; | return false; | ||||
} | } | ||||
void PrintExceptionContinue(const std::exception *pex, const char *pszThread); | void PrintExceptionContinue(const std::exception *pex, const char *pszThread); | ||||
void FileCommit(FILE *file); | void FileCommit(FILE *file); | ||||
bool TruncateFile(FILE *file, unsigned int length); | bool TruncateFile(FILE *file, unsigned int length); | ||||
int RaiseFileDescriptorLimit(int nMinFD); | int RaiseFileDescriptorLimit(int nMinFD); | ||||
void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length); | void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length); | ||||
▲ Show 20 Lines • Show All 153 Lines • Show Last 20 Lines |