Dogecoin Core
1.14.2
P2P Digital Currency
|
#include "util.h"
#include "chainparamsbase.h"
#include "random.h"
#include "serialize.h"
#include "sync.h"
#include "utilstrencodings.h"
#include "utiltime.h"
#include <stdarg.h>
#include <algorithm>
#include <fcntl.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/algorithm/string/join.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <boost/filesystem.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/foreach.hpp>
#include <boost/program_options/detail/config_file.hpp>
#include <boost/program_options/parsers.hpp>
#include <boost/thread.hpp>
#include <openssl/crypto.h>
#include <openssl/rand.h>
#include <openssl/conf.h>
Go to the source code of this file.
Classes | |
class | CInit |
Functions | |
std::atomic< bool > | fReopenDebugLog (false) |
void | locking_callback (int mode, int i, const char *file, int line) NO_THREAD_SAFETY_ANALYSIS |
void | OpenDebugLog () |
bool | LogAcceptCategory (const char *category) |
Return true if log accepts specified category. More... | |
int | LogPrintStr (const std::string &str) |
Send a string to the log output. More... | |
void | ParseParameters (int argc, const char *const argv[]) |
bool | IsArgSet (const std::string &strArg) |
Return true if the given argument has been manually set. More... | |
std::string | GetArg (const std::string &strArg, const std::string &strDefault) |
Return string argument or default value. More... | |
int64_t | GetArg (const std::string &strArg, int64_t nDefault) |
Return integer argument or default value. More... | |
bool | GetBoolArg (const std::string &strArg, bool fDefault) |
Return boolean argument or default value. More... | |
bool | SoftSetArg (const std::string &strArg, const std::string &strValue) |
Set an argument if it doesn't already have a value. More... | |
bool | SoftSetBoolArg (const std::string &strArg, bool fValue) |
Set a boolean argument if it doesn't already have a value. More... | |
void | ForceSetArg (const std::string &strArg, const std::string &strValue) |
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... | |
void | PrintExceptionContinue (const std::exception *pex, const char *pszThread) |
boost::filesystem::path | GetDefaultDataDir () |
const boost::filesystem::path & | GetDataDir (bool fNetSpecific) |
void | ClearDatadirCache () |
boost::filesystem::path | GetConfigFile (const std::string &confPath) |
void | ReadConfigFile (const std::string &confPath) |
boost::filesystem::path | GetPidFile () |
void | CreatePidFile (const boost::filesystem::path &path, pid_t pid) |
bool | RenameOver (boost::filesystem::path src, boost::filesystem::path dest) |
bool | TryCreateDirectory (const boost::filesystem::path &p) |
Ignores exceptions thrown by Boost's create_directory if the requested directory exists. More... | |
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... | |
void | ShrinkDebugFile () |
void | runCommand (const std::string &strCommand) |
void | RenameThread (const char *name) |
void | SetupEnvironment () |
bool | SetupNetworking () |
int | GetNumCores () |
Return the number of physical cores available on the current system. More... | |
std::string | CopyrightHolders (const std::string &strPrefix) |
Variables | |
const char *const | BITCOIN_CONF_FILENAME = "dogecoin.conf" |
const char *const | BITCOIN_PID_FILENAME = "dogecoind.pid" |
CCriticalSection | cs_args |
map< string, string > | mapArgs |
const map< string, vector< string > > & | mapMultiArgs = _mapMultiArgs |
bool | fDebug = false |
bool | fPrintToConsole = false |
bool | fPrintToDebugLog = true |
bool | fLogTimestamps = DEFAULT_LOGTIMESTAMPS |
bool | fLogTimeMicros = DEFAULT_LOGTIMEMICROS |
bool | fLogIPs = DEFAULT_LOGIPS |
CTranslationInterface | translationInterface |
class CInit | instance_of_cinit |
void AllocateFileRange | ( | FILE * | file, |
unsigned int | offset, | ||
unsigned int | length | ||
) |
std::string CopyrightHolders | ( | const std::string & | strPrefix | ) |
void CreatePidFile | ( | const boost::filesystem::path & | path, |
pid_t | pid | ||
) |
void ForceSetArg | ( | const std::string & | strArg, |
const std::string & | strValue | ||
) |
std::atomic<bool> fReopenDebugLog | ( | false | ) |
std::string GetArg | ( | const std::string & | strArg, |
const std::string & | strDefault | ||
) |
int64_t GetArg | ( | const std::string & | strArg, |
int64_t | nDefault | ||
) |
bool GetBoolArg | ( | const std::string & | strArg, |
bool | fDefault | ||
) |
boost::filesystem::path GetConfigFile | ( | const std::string & | confPath | ) |
const boost::filesystem::path& GetDataDir | ( | bool | fNetSpecific | ) |
boost::filesystem::path GetDefaultDataDir | ( | ) |
int GetNumCores | ( | ) |
boost::filesystem::path GetPidFile | ( | ) |
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 452 of file util.cpp.
bool IsArgSet | ( | const std::string & | strArg | ) |
void locking_callback | ( | int | mode, |
int | i, | ||
const char * | file, | ||
int | line | ||
) |
bool LogAcceptCategory | ( | const char * | category | ) |
int LogPrintStr | ( | const std::string & | str | ) |
void ParseParameters | ( | int | argc, |
const char *const | argv[] | ||
) |
void PrintExceptionContinue | ( | const std::exception * | pex, |
const char * | pszThread | ||
) |
int RaiseFileDescriptorLimit | ( | int | nMinFD | ) |
void ReadConfigFile | ( | const std::string & | confPath | ) |
bool RenameOver | ( | boost::filesystem::path | src, |
boost::filesystem::path | dest | ||
) |
void RenameThread | ( | const char * | name | ) |
void runCommand | ( | const std::string & | strCommand | ) |
void SetupEnvironment | ( | ) |
bool SetupNetworking | ( | ) |
void ShrinkDebugFile | ( | ) |
bool SoftSetArg | ( | const std::string & | strArg, |
const std::string & | strValue | ||
) |
bool SoftSetBoolArg | ( | const std::string & | strArg, |
bool | fValue | ||
) |
Set a boolean argument if it doesn't already have a value.
strArg | Argument to set (e.g. "-foo") |
fValue | Value (e.g. false) |
Definition at line 428 of file util.cpp.
bool TryCreateDirectory | ( | const boost::filesystem::path & | p | ) |
CCriticalSection cs_args |
class CInit instance_of_cinit |
const map<string, vector<string> >& mapMultiArgs = _mapMultiArgs |
CTranslationInterface translationInterface |