Fabcoin Core
0.16.2
P2P Digital Currency
|
#include <compat.h>
#include <fs.h>
#include <sync.h>
#include <tinyformat.h>
#include <utiltime.h>
#include <atomic>
#include <exception>
#include <map>
#include <stdint.h>
#include <string>
#include <vector>
#include <boost/signals2/signal.hpp>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
Go to the source code of this file.
Classes | |
class | CTranslationInterface |
Signals for translation. More... | |
struct | CLogCategoryActive |
class | ArgsManager |
Namespaces | |
BCLog | |
Macros | |
#define | LogPrintf(...) |
#define | LogPrint(category, ...) |
#define | LogPrintChar(category, ...) |
Enumerations | |
enum | BCLog::LogFlags : uint32_t { BCLog::NONE = 0, BCLog::NET = (1 << 0), BCLog::TOR = (1 << 1), BCLog::MEMPOOL = (1 << 2), BCLog::HTTP = (1 << 3), BCLog::BENCH = (1 << 4), BCLog::ZMQ = (1 << 5), BCLog::DB = (1 << 6), BCLog::RPC = (1 << 7), BCLog::ESTIMATEFEE = (1 << 8), BCLog::ADDRMAN = (1 << 9), BCLog::SELECTCOINS = (1 << 10), BCLog::REINDEX = (1 << 11), BCLog::CMPCTBLOCK = (1 << 12), BCLog::RAND = (1 << 13), BCLog::PRUNE = (1 << 14), BCLog::PROXY = (1 << 15), BCLog::MEMPOOLREJ = (1 << 16), BCLog::LIBEVENT = (1 << 17), BCLog::COINDB = (1 << 18), BCLog::QT = (1 << 19), BCLog::LEVELDB = (1 << 20), BCLog::HTTPPOLL = (1 << 22), BCLog::POW = (1 << 30), BCLog::ALL = ~(uint32_t)0 } |
Functions | |
int64_t | GetStartupTime () |
Server/client environment: argument handling, config file parsing, logging, thread wrappers, startup time. More... | |
std::string | _ (const char *psz) |
Translation function: Call Translate signal on UI interface, which returns a boost::optional result. More... | |
void | SetupEnvironment () |
bool | SetupNetworking () |
bool | LogAcceptCategoryChar (const char *category) |
Return true if log accepts specified category. More... | |
std::string | ListLogCategories () |
Returns a string with the log categories. More... | |
std::vector< CLogCategoryActive > | ListActiveLogCategories () |
Returns a vector of the active log categories. More... | |
bool | GetLogCategory (uint32_t *f, const std::string *str) |
Return true if str parses as a log category and set the flags in f. More... | |
int | LogPrintStr (const std::string &str, bool useVMLog=false) |
Send a string to the log output. More... | |
template<typename... Args> | |
std::string | FormatStringFromLogArgs (const char *fmt, const Args &...args) |
Get format string from VA_ARGS for error reporting. More... | |
template<typename... Args> | |
bool | error (const char *fmt, const Args &...args) |
void | PrintExceptionContinue (const std::exception *pex, const char *pszThread) |
void | FileCommit (FILE *file) |
bool | TruncateFile (FILE *file, unsigned int length) |
int | RaiseFileDescriptorLimit (int nMinFD) |
this function tries to raise the file descriptor limit to the requested number. More... | |
void | AllocateFileRange (FILE *file, unsigned int offset, unsigned int length) |
this function tries to make a particular range of a file allocated (corresponding to disk space) it is advisory, and the range specified in the arguments will never contain live data More... | |
bool | RenameOver (fs::path src, fs::path dest) |
bool | TryCreateDirectories (const fs::path &p) |
Ignores exceptions thrown by Boost's create_directories if the requested directory exists. More... | |
fs::path | GetDefaultDataDir () |
const fs::path & | GetDataDir (bool fNetSpecific=true) |
void | ClearDatadirCache () |
fs::path | GetConfigFile (const std::string &confPath) |
fs::path | GetPidFile () |
void | CreatePidFile (const fs::path &path, pid_t pid) |
void | OpenDebugLog () |
void | ShrinkDebugFile () |
void | runCommand (const std::string &strCommand) |
bool | IsSwitchChar (char c) |
std::string | HelpMessageGroup (const std::string &message) |
Format a string to be used as group of options in help messages. More... | |
std::string | HelpMessageOpt (const std::string &option, const std::string &message) |
Format a string to be used as option description in help messages. More... | |
int | GetNumCores () |
Return the number of physical cores available on the current system. More... | |
void | SetThreadPriority (int nPriority) |
void | RenameThread (const char *name) |
template<typename Callable > | |
void | TraceThread (const char *name, Callable func) |
std::string | CopyrightHolders (const std::string &strPrefix) |
bool | CheckHex (const std::string &str) |
Variables | |
bool | fPrintToConsole |
bool | fPrintToDebugLog |
bool | fLogTimestamps |
bool | fLogTimeMicros |
bool | fLogIPs |
std::atomic< bool > | fReopenDebugLog |
CTranslationInterface | translationInterface |
const char *const | FABCOIN_CONF_FILENAME |
const char *const | FABCOIN_PID_FILENAME |
std::atomic< uint32_t > | logCategories |
ArgsManager | gArgs |
#define LogPrintChar | ( | category, | |
... | |||
) |
#define LogPrintf | ( | ... | ) |
|
inline |
Translation function: Call Translate signal on UI interface, which returns a boost::optional result.
If no translation slot is registered, nothing is returned, and simply return the input.
Definition at line 71 of file util.h.
void AllocateFileRange | ( | FILE * | file, |
unsigned int | offset, | ||
unsigned int | length | ||
) |
bool CheckHex | ( | const std::string & | str | ) |
void ClearDatadirCache | ( | ) |
std::string CopyrightHolders | ( | const std::string & | strPrefix | ) |
void CreatePidFile | ( | const fs::path & | path, |
pid_t | pid | ||
) |
bool error | ( | const char * | fmt, |
const Args &... | args | ||
) |
void FileCommit | ( | FILE * | file | ) |
std::string FormatStringFromLogArgs | ( | const char * | fmt, |
const Args &... | args | ||
) |
fs::path GetConfigFile | ( | const std::string & | confPath | ) |
const fs::path& GetDataDir | ( | bool | fNetSpecific = true | ) |
fs::path GetDefaultDataDir | ( | ) |
bool GetLogCategory | ( | uint32_t * | f, |
const std::string * | str | ||
) |
int GetNumCores | ( | ) |
fs::path GetPidFile | ( | ) |
int64_t GetStartupTime | ( | ) |
std::string HelpMessageGroup | ( | const std::string & | message | ) |
std::string HelpMessageOpt | ( | const std::string & | option, |
const std::string & | message | ||
) |
Format a string to be used as option description in help messages.
option | Option message (e.g. "-rpcuser=<user>") |
message | Option description (e.g. "Username for JSON-RPC connections") |
Definition at line 563 of file util.cpp.
|
inline |
std::vector<CLogCategoryActive> ListActiveLogCategories | ( | ) |
std::string ListLogCategories | ( | ) |
bool LogAcceptCategoryChar | ( | const char * | category | ) |
int LogPrintStr | ( | const std::string & | str, |
bool | useVMLog = false |
||
) |
void OpenDebugLog | ( | ) |
void PrintExceptionContinue | ( | const std::exception * | pex, |
const char * | pszThread | ||
) |
int RaiseFileDescriptorLimit | ( | int | nMinFD | ) |
bool RenameOver | ( | fs::path | src, |
fs::path | dest | ||
) |
void RenameThread | ( | const char * | name | ) |
void runCommand | ( | const std::string & | strCommand | ) |
void SetThreadPriority | ( | int | nPriority | ) |
void SetupEnvironment | ( | ) |
bool SetupNetworking | ( | ) |
void ShrinkDebugFile | ( | ) |
void TraceThread | ( | const char * | name, |
Callable | func | ||
) |
bool TruncateFile | ( | FILE * | file, |
unsigned int | length | ||
) |
bool TryCreateDirectories | ( | const fs::path & | p | ) |
std::atomic<bool> fReopenDebugLog |
ArgsManager gArgs |
std::atomic<uint32_t> logCategories |
CTranslationInterface translationInterface |