Pol  Revision:cb584c9
Pol::Clib Namespace Reference

Namespaces

 Logging
 
 Pol
 

Classes

class  access_violation
 
class  BinaryFile
 
class  ci_cmp_pred
 
class  CNTService
 
class  ConfigElem
 
class  ConfigElemBase
 
class  ConfigFile
 
class  ConfigProperty
 
class  ConfigSection
 
class  ConfigSource
 
class  DirList
 
class  ExceptionParser
 
class  FileContents
 
class  fixed_allocator
 
class  FMTStreamWriter
 
class  HiddenMiniDumper
 
class  KeyboardHook
 
class  message_queue
 
class  MiniDumper
 
class  MSJExceptionHandler
 
class  OFStreamWriter
 
class  OnlineStatistics
 
class  OStreamWriter
 
class  PolMain
 
class  PolToolMain
 
class  ProgramConfig
 
class  ProgramMain
 
class  PushDir
 
class  RunEclMain
 
class  Socket
 
class  SocketClientThread
 
class  SocketListener
 
class  SpinLock
 
class  StackWalkerLogger
 
class  StreamWriter
 
class  StringSet
 
class  structured_exception
 
class  StubConfigSource
 
class  ThreadedOFStreamWriter
 
struct  TraceBufferElem
 
class  UnitTest
 
class  VectorConfigElem
 

Typedefs

typedef char Directory[MAXFULLDIR]
 
typedef char FFile[MAXFNAME]
 
typedef char File1[MAXFILE]
 
typedef char Pathname[MAXPATH]
 
typedef std::lock_guard< SpinLockSpinLockGuard
 
typedef unsigned int wallclock_diff_t
 
typedef unsigned int wallclock_t
 

Enumerations

enum  {
  SRC_NO_EXIST = 1, DST_ALREADY_EXIST, SRC_OPEN_ERROR, DST_OPEN_ERROR,
  WRITE_ERROR
}
 

Functions

static void _thread_stub2 (void *arg)
 
void _tracebuffer_addelem (const char *tag, unsigned int value)
 
template<class T , size_t N>
CONSTEXPR size_t arsize (T(&)[N])
 
char * binary (unsigned int val, int nbits)
 
char * buildfn (const char *directory, const char *filename)
 
char * buildfnext (const char *directory, const char *filename, const char *extension)
 
int chddir (const char *dir)
 
int copyFile (const char *src, const char *dst)
 
int copyFileNoRep (const char *src, const char *dst)
 
void ctrlc_handler (int x)
 
std::string curdir ()
 
std::string decint (unsigned short v)
 
std::string decint (signed int v)
 
std::string decint (unsigned int v)
 
std::string decint (signed long v)
 
std::string decint (unsigned long v)
 
void decodequotedstring (std::string &str)
 
char ** decompose1 (char *cmdline, int *pargc)
 
template<class T >
void delete_all (T &coll)
 
void dump16 (fmt::Writer &writer, const unsigned char *s, int len)
 
void enable_exit_signaller ()
 
void encodequotedstring (std::string &str)
 
std::atomic< bool > exit_signalled (false)
 
template<class D , class S >
explicit_cast (const S &s)
 
int favail (void)
 
void fdump (fmt::Writer &writer, const void *data, int len)
 
bool FileExists (const char *filename)
 
bool FileExists (const std::string &filename)
 
int filesize (const char *fname)
 
bool flags_clear (u32 value, u32 flags)
 
bool flags_set (u32 value, u32 flags)
 
void force_backtrace (bool complete)
 
int forspec (const char *spec, void(*func)(const char *pathname))
 
char * fullmerge (char *path)
 
std::string FullPath (const char *filename)
 
int fullsplit (const char *path)
 
size_t getCurrentMemoryUsage ()
 returns the current process size in bytes More...
 
std::string getencodedquotedstring (const std::string &in)
 
std::string GetFilePart (const char *filename)
 
unsigned int GetFileTimestamp (const char *fname)
 
std::string GetTrueName (const char *filename)
 
static void handleSignalLinux (int signal, siginfo_t *signalInfo, void *arg)
 
static void handleStackTraceRequestLinux (int signal, siginfo_t *signalInfo, void *arg)
 
std::string hexint (unsigned short v)
 
std::string hexint (signed int v)
 
std::string hexint (unsigned int v)
 
std::string hexint (signed long v)
 
std::string hexint (unsigned long v)
 
template<class D , class S >
implicit_cast (const S &s)
 
void incStr (char *str)
 
static int inner_copy (const char *src, const char *dst, int replaceOk)
 
static int inner_move (const char *src, const char *dst, int replaceOk)
 
void InstallOldStructuredExceptionHandler (void)
 
bool IsDirectory (const char *dir)
 
void legalize (char *s, const char *allowed)
 
std::tm localtime (const std::time_t &t)
 threadsafe version of localtime More...
 
void LogTraceBuffer ()
 
int make_dir (const char *dir)
 
void MakeDirectory (const char *dir)
 
int match (char *a, char *b)
 
void MD5_Cleanup ()
 
bool MD5_Compare (const std::string &a, const std::string &b)
 
bool MD5_Encrypt (const std::string &in, std::string &out)
 
char * mergeFnExt (char *fname)
 
void mklower (std::string &str)
 
void mkupper (std::string &str)
 
int moveFile (const char *src, const char *dst)
 
int moveFileNoRep (const char *src, const char *dst)
 
char * nodefile (const char *directory, const char *filename, int node)
 
void normalize_dir (char *dir)
 
std::string normalized_dir_form (const std::string &istr)
 
int nwords (const char *s)
 
void open_file (std::fstream &ofs, std::string &filename, std::ios::openmode mode)
 
void open_file (std::ofstream &ofs, std::string &filename, std::ios::openmode mode)
 
void open_file (std::ifstream &ifs, std::string &filename, std::ios::openmode mode)
 
void passert_failed (const char *expr, const char *file, unsigned line)
 
void passert_failed (const char *expr, const std::string &reason, const char *file, unsigned line)
 
void PrintHeapData ()
 
double random_double (double f)
 
int random_int (int i)
 
int random_int_range (int minI, int maxI)
 
bool readline (Socket &sck, std::string &s, bool *timeout_exit, unsigned int timeout_secs, unsigned maxlen)
 
bool readstring (Socket &sck, std::string &s, unsigned int interchar_secs, unsigned length)
 
void RemoveFile (const std::string &fname)
 
template<typename T >
void sanitize_bounds (T *value, const T min, const T max)
 
template<typename T >
void sanitize_lowerlimit (T *value, const T min)
 
template<typename T >
void sanitize_upperlimit (T *value, const T max)
 
void splitnamevalue (const std::string &istr, std::string &propname, std::string &propvalue)
 
char * stracpy (char *dest, const char *src, size_t maxlen)
 
template<class S1 , class S2 >
int stringicmp (const S1 &str1, const S2 &str2)
 
template<class S1 , const char * >
int stringicmp (const S1 &str1, const char *str2)
 
template<const char * , class S2 >
int stringicmp (const char *str1, const S2 &str2)
 
char * strip (char *s)
 
int strip_one (std::string &direc)
 
std::string strlower (const std::string &str)
 
char * strpcpy (char *dest, const char *src, size_t maxlen)
 
std::string strupper (const std::string &str)
 
void test_convertquotedstring ()
 
void test_dqs (const std::string &in, const std::string &out)
 
void test_splitnamevalue (const std::string &istr, const std::string &exp_pn, const std::string &exp_pv)
 
void test_splitnamevalue ()
 
template<>
std::string tostring (const Bscript::BTokenType &v)
 
template<>
std::string tostring (const Bscript::BTokenId &v)
 
template<class T >
std::string tostring (const T &v)
 
wallclock_t wallclock ()
 
wallclock_diff_t wallclock_diff_ms (wallclock_t start, wallclock_t finish)
 
void writeline (Socket &sck, const std::string &s)
 

Variables

static unsigned int blocks_allocated = 0
 
static unsigned int bytes_allocated = 0
 
const unsigned CST_MANDATORY = 1
 
const unsigned CST_NORMAL = 0
 
const unsigned CST_UNIQUE = 2
 
std::atomic< bool > exit_signalled
 
const std::size_t flush_limit = 10000
 
static Pathname fullpath2
 
MSJExceptionHandler g_MSJExceptionHandler
 
HMODULE hDbgHelpDll
 
static unsigned int last_blocks_allocated = 0
 
static unsigned int last_bytes_allocated = 0
 
bool LogfileTimestampEveryLine = false
 
int mydir_errno
 
bool passert_abort = true
 
bool passert_dump_stack = false
 
bool passert_nosave = false
 
bool passert_shutdown = false
 
bool passert_shutdown_due_to_assertion = false
 
std::string scripts_thread_script
 
unsigned scripts_thread_scriptPC
 
char temp_dir [MAXDIR]
 
char temp_drive [MAXDRIVE]
 
char temp_ext [MAXEXT]
 
char temp_fname [MAXFILE]
 
char temp_path [MAXPATH]
 
UnitTest test_convertquotedstring_obj (test_convertquotedstring)
 
UnitTest test_splitnamevalue_obj (test_splitnamevalue)
 
TraceBufferElem tracebuffer [TRACEBUF_DEPTH]
 
unsigned tracebuffer_insertpoint
 
static Pathname workspace2
 

Detailed Description

CLib namespace is for functions that a general app may need, not necessarily related to POL at all (string manipulation, for example)

Typedef Documentation

typedef char Pol::Clib::Directory[MAXFULLDIR]

Definition at line 19 of file dirfunc.h.

typedef char Pol::Clib::FFile[MAXFNAME]

Definition at line 21 of file dirfunc.h.

typedef char Pol::Clib::File1[MAXFILE]

Definition at line 20 of file dirfunc.h.

typedef char Pol::Clib::Pathname[MAXPATH]

Definition at line 22 of file dirfunc.h.

typedef std::lock_guard<SpinLock> Pol::Clib::SpinLockGuard

This is a std::lock_guard specific for SpinLock

Definition at line 33 of file spinlock.h.

typedef unsigned int Pol::Clib::wallclock_diff_t

Definition at line 9 of file wallclock.h.

typedef unsigned int Pol::Clib::wallclock_t

Definition at line 8 of file wallclock.h.

Enumeration Type Documentation

anonymous enum
Enumerator
SRC_NO_EXIST 
DST_ALREADY_EXIST 
SRC_OPEN_ERROR 
DST_OPEN_ERROR 
WRITE_ERROR 

Definition at line 40 of file dirfunc.h.

Function Documentation

static void Pol::Clib::_thread_stub2 ( void *  arg)
static
void Pol::Clib::_tracebuffer_addelem ( const char *  tag,
unsigned int  value 
)
inline
template<class T , size_t N>
CONSTEXPR size_t Pol::Clib::arsize ( T(&)  [N])

Definition at line 87 of file stlutil.h.

char * Pol::Clib::buildfn ( const char *  directory,
const char *  filename 
)

Definition at line 134 of file dirfunc.cpp.

References fullpath2.

char * Pol::Clib::buildfnext ( const char *  directory,
const char *  filename,
const char *  extension 
)

Definition at line 144 of file dirfunc.cpp.

References fullpath2.

int Pol::Clib::chddir ( const char *  dir)

Definition at line 76 of file dirfunc.cpp.

int Pol::Clib::copyFile ( const char *  src,
const char *  dst 
)

Definition at line 255 of file dirfunc.cpp.

References inner_copy().

int Pol::Clib::copyFileNoRep ( const char *  src,
const char *  dst 
)

Definition at line 261 of file dirfunc.cpp.

References inner_copy().

void Pol::Clib::ctrlc_handler ( int  x)

Definition at line 60 of file esignal.cpp.

References exit_signalled.

Referenced by enable_exit_signaller().

std::string Pol::Clib::curdir ( )

Definition at line 160 of file dirlist.cpp.

References normalized_dir_form().

std::string Pol::Clib::decint ( unsigned short  v)

Definition at line 64 of file strutil.cpp.

References OSTRINGSTREAM, and OSTRINGSTREAM_STR.

Referenced by Pol::Bscript::EScriptProgram::_readToken(), Pol::Items::Item::add_to_self(), Pol::Clib::Socket::apply_prebind_socket_options(), Pol::Clib::Socket::apply_socket_options(), Pol::Network::apply_socket_options(), Pol::Bscript::StoredTokenContainer::atGet1(), Pol::Bscript::StoredTokenContainer::atPut1(), Pol::Items::Item::call_custom_method(), Pol::Core::DebugContext::cmd_fileline(), Pol::Core::DebugContext::cmd_files(), Pol::Core::DebugContext::cmd_funclist(), Pol::Core::DebugContext::cmd_globalvars(), Pol::Core::DebugContext::cmd_inslist(), Pol::Core::DebugContext::cmd_pidlist(), Pol::Core::DebugContext::cmd_scriptins(), Pol::Core::DebugContext::cmd_scriptprofile(), Pol::Core::DebugContext::cmd_scriptsrc(), Pol::Core::DebugContext::cmd_srcprof(), Pol::Core::DebugContext::cmd_stacktrace(), Pol::Core::commit_incremental_saves(), Pol::Items::Item::create(), decint(), Pol::Clib::Socket::disable_nagle(), Pol::Network::disable_nagle(), Pol::Core::elapsed(), Pol::Bscript::Compiler::emitFileLine(), Pol::Core::find_giveitem_container(), Pol::Core::getCharacterOrClientParam(), Pol::Core::getCharacterParam(), Pol::Clib::BinaryFile::GetElementCount(), Pol::Core::GetGlobals(), Pol::Bscript::Executor::getParam(), Pol::Bscript::Executor::getParamImp2(), Pol::Module::gumpbutton_handler(), Pol::Core::load_incremental_indexes(), Pol::Core::load_realms(), Pol::Plib::MapServer::LoadSecondLevelIndex(), Pol::Network::open_listen_socket(), Pol::Items::ItemDesc::PopulateStruct(), Pol::Core::read_incremental_saves(), Pol::Core::read_movecost(), Pol::Clib::BinaryFile::ReadBuffer(), Pol::Bscript::SymbolContainer::resize(), Pol::Core::save_incremental(), Pol::Core::send_binary(), Pol::Core::RepSystem::show_repdata(), Pol::Clib::SocketListener::SocketListener(), Pol::Network::Client::status(), Pol::Core::textcmd_procs(), Pol::Core::textcmd_threads(), Pol::Core::timeoutstr(), Pol::xmain_inner(), and Pol::Module::ItemGivenEvent::~ItemGivenEvent().

std::string Pol::Clib::decint ( signed int  v)

Definition at line 71 of file strutil.cpp.

References OSTRINGSTREAM, and OSTRINGSTREAM_STR.

std::string Pol::Clib::decint ( unsigned int  v)

Definition at line 78 of file strutil.cpp.

References OSTRINGSTREAM, and OSTRINGSTREAM_STR.

std::string Pol::Clib::decint ( signed long  v)

Definition at line 85 of file strutil.cpp.

References OSTRINGSTREAM, and OSTRINGSTREAM_STR.

std::string Pol::Clib::decint ( unsigned long  v)

Definition at line 91 of file strutil.cpp.

References decint(), OSTRINGSTREAM, and OSTRINGSTREAM_STR.

void Pol::Clib::decodequotedstring ( std::string &  str)

Definition at line 167 of file strutil.cpp.

Referenced by Pol::Clib::ConfigFile::read_properties(), and test_dqs().

char** Pol::Clib::decompose1 ( char *  cmdline,
int *  pargc 
)

make a char** array suitable for call to exec() or spawn()

Returns
the argc in *pargc.
void Pol::Clib::dump16 ( fmt::Writer &  writer,
const unsigned char *  s,
int  len 
)

Definition at line 13 of file fdump.cpp.

Referenced by fdump().

void Pol::Clib::enable_exit_signaller ( )

Definition at line 65 of file esignal.cpp.

References ctrlc_handler().

Referenced by Pol::Core::PolSig::PolSig(), and Pol::ECompile::run().

void Pol::Clib::encodequotedstring ( std::string &  str)

Definition at line 204 of file strutil.cpp.

Referenced by getencodedquotedstring(), and test_dqs().

std::atomic<bool> Pol::Clib::exit_signalled ( false  )
int Pol::Clib::favail ( void  )

how many file handles are available?

void Pol::Clib::fdump ( fmt::Writer &  writer,
const void *  data,
int  len 
)
bool Pol::Clib::FileExists ( const char *  filename)

Definition at line 118 of file fileutil.cpp.

Referenced by Pol::Core::commit(), Pol::Core::commit_incremental(), Pol::ECompile::compile_file(), Pol::Core::decode_page(), Pol::Core::ScriptDef::exists(), Pol::Core::FindConfigFile(), Pol::Module::PackageObjImp::get_member(), Pol::Core::get_textcmd_help(), Pol::Bscript::Compiler::getFileContents(), Pol::Plib::GetPackageCfgPath(), Pol::Core::implicit_package_cmds_cfg(), Pol::Core::import_new_data(), Pol::Bscript::Compiler::includeModule(), Pol::Module::DataStoreFile::load(), Pol::Plib::load_all_cfgs(), Pol::Core::load_anim_xlate_cfg(), Pol::Mobile::load_armor_zones(), Pol::Core::load_circle_data(), Pol::Core::ConsoleCommand::load_console_commands(), Pol::Module::load_fileaccess_cfg(), Pol::Core::load_incremental_indexes(), Pol::Items::load_itemdesc(), Pol::Core::load_mime_config(), Pol::Core::load_movecost(), Pol::Items::load_npc_intrinsic_equip(), Pol::Core::load_npc_templates(), Pol::Core::load_package_cmdlevels(), Pol::Items::load_package_itemdesc(), Pol::Plib::load_packaged_cfgs(), Pol::Plib::load_packages(), Pol::Core::load_party_cfg(), Pol::Core::load_resource_cfg(), Pol::Multi::load_special_storedconfig(), Pol::Core::load_spell_data(), Pol::Core::load_stacking_cfg(), Pol::Core::load_system_hooks(), Pol::Core::LoadTusScpFile(), Pol::Core::MemoryUsage::log(), Pol::UoConvert::UoConvertMain::main(), Pol::Module::DataFileExecutorModule::mf_CreateDataFile(), Pol::Module::FileAccessExecutorModule::mf_FileExists(), Pol::Module::FileAccessExecutorModule::mf_WriteFile(), Pol::Mobile::NPC::on_death(), Pol::Mobile::Character::on_death(), Pol::Core::open_map_file(), Pol::Core::open_uo_data_files(), Pol::Core::open_uopmap_file(), Pol::Network::read_bannedips_config(), Pol::Core::CombatConfig::read_combat_config(), Pol::ECompile::read_config_file(), Pol::Core::read_data(), Pol::Module::read_datastore_dat(), Pol::Core::read_extobj(), Pol::Bscript::Compiler::read_function_declarations_in_included_file(), Pol::Core::read_guilds_dat(), Pol::Core::Menu::read_menus(), Pol::Core::read_npc_templates(), Pol::Core::read_party_dat(), Pol::Core::read_region_data(), Pol::Core::read_resources_dat(), Pol::Core::ServSpecOpt::read_servspecopt(), Pol::Core::read_storage_dat(), Pol::Core::rndat(), Pol::Core::run_start_scripts(), Pol::Core::set_watch_vars(), Pol::Core::slurp(), Pol::Clib::PolToolMain::unpackCompressedGump(), and Pol::Bscript::Compiler::useModule().

bool Pol::Clib::FileExists ( const std::string &  filename)

Definition at line 122 of file fileutil.cpp.

int Pol::Clib::filesize ( const char *  fname)
bool Pol::Clib::flags_clear ( u32  value,
u32  flags 
)

Definition at line 66 of file mapfunc.cpp.

Referenced by Pol::Plib::polflags_from_tileflags().

bool Pol::Clib::flags_set ( u32  value,
u32  flags 
)

Definition at line 61 of file mapfunc.cpp.

Referenced by Pol::Plib::polflags_from_tileflags().

int Pol::Clib::forspec ( const char *  spec,
void(*)(const char *pathname)  func 
)

perform a function on all files meeting a file spec

Definition at line 15 of file forspcnt.cpp.

References strzcpy.

Referenced by Pol::ECompile::run().

char * Pol::Clib::fullmerge ( char *  path)

Definition at line 50 of file dirfunc.cpp.

std::string Pol::Clib::FullPath ( const char *  filename)
int Pol::Clib::fullsplit ( const char *  path)

Definition at line 34 of file dirfunc.cpp.

size_t Pol::Clib::getCurrentMemoryUsage ( )

returns the current process size in bytes

Definition at line 26 of file xmain.cpp.

Referenced by Pol::Module::GetCoreVariable(), and Pol::Core::MemoryUsage::log().

std::string Pol::Clib::getencodedquotedstring ( const std::string &  in)

Definition at line 235 of file strutil.cpp.

References encodequotedstring().

Referenced by Pol::Mobile::Character::printProperties().

std::string Pol::Clib::GetFilePart ( const char *  filename)

Definition at line 175 of file fileutil.cpp.

Referenced by Pol::Bscript::Compiler::getFileContents().

unsigned int Pol::Clib::GetFileTimestamp ( const char *  fname)

Definition at line 135 of file fileutil.cpp.

Referenced by Pol::ECompile::compile_file().

std::string Pol::Clib::GetTrueName ( const char *  filename)
static void Pol::Clib::handleSignalLinux ( int  signal,
siginfo_t *  signalInfo,
void *  arg 
)
static
static void Pol::Clib::handleStackTraceRequestLinux ( int  signal,
siginfo_t *  signalInfo,
void *  arg 
)
static
std::string Pol::Clib::hexint ( signed int  v)

Definition at line 30 of file strutil.cpp.

References OSTRINGSTREAM, and OSTRINGSTREAM_STR.

std::string Pol::Clib::hexint ( unsigned int  v)

Definition at line 36 of file strutil.cpp.

References OSTRINGSTREAM, and OSTRINGSTREAM_STR.

std::string Pol::Clib::hexint ( signed long  v)

Definition at line 43 of file strutil.cpp.

References OSTRINGSTREAM, and OSTRINGSTREAM_STR.

std::string Pol::Clib::hexint ( unsigned long  v)

Definition at line 49 of file strutil.cpp.

References hexint(), OSTRINGSTREAM, and OSTRINGSTREAM_STR.

template<class D , class S >
D Pol::Clib::implicit_cast ( const S &  s)
inline

Definition at line 34 of file stlutil.h.

void Pol::Clib::incStr ( char *  str)

take a string, increment alphas, 'ZZZZ' converts to 'AAAA', etc

static int Pol::Clib::inner_copy ( const char *  src,
const char *  dst,
int  replaceOk 
)
static
static int Pol::Clib::inner_move ( const char *  src,
const char *  dst,
int  replaceOk 
)
static

Definition at line 267 of file dirfunc.cpp.

References inner_copy().

Referenced by moveFile(), and moveFileNoRep().

void Pol::Clib::InstallOldStructuredExceptionHandler ( void  )
void Pol::Clib::legalize ( char *  s,
const char *  allowed 
)

remove all occurrences of characters not in allowed from s

void Pol::Clib::LogTraceBuffer ( )
int Pol::Clib::make_dir ( const char *  dir)
void Pol::Clib::MakeDirectory ( const char *  dir)
int Pol::Clib::match ( char *  a,
char *  b 
)

do first strlen(b) chars of a and b match? match(s, "tag")

Referenced by Pol::Core::DebugContext::cmd_pidlist().

void Pol::Clib::MD5_Cleanup ( )

Definition at line 112 of file clib_MD5.cpp.

Referenced by Pol::Core::GameState::deinitialize().

bool Pol::Clib::MD5_Compare ( const std::string &  a,
const std::string &  b 
)
bool Pol::Clib::MD5_Encrypt ( const std::string &  in,
std::string &  out 
)
char * Pol::Clib::mergeFnExt ( char *  fname)

Definition at line 65 of file dirfunc.cpp.

References strzcpy.

void Pol::Clib::mkupper ( std::string &  str)

Definition at line 271 of file strutil.cpp.

Referenced by Pol::Core::get_textcmd_help(), and Pol::Core::start_textcmd_script().

int Pol::Clib::moveFile ( const char *  src,
const char *  dst 
)

Definition at line 282 of file dirfunc.cpp.

References inner_move().

int Pol::Clib::moveFileNoRep ( const char *  src,
const char *  dst 
)

Definition at line 287 of file dirfunc.cpp.

References inner_move().

char * Pol::Clib::nodefile ( const char *  directory,
const char *  filename,
int  node 
)

Definition at line 123 of file dirfunc.cpp.

References fullpath2.

void Pol::Clib::normalize_dir ( char *  dir)

Definition at line 159 of file dirfunc.cpp.

int Pol::Clib::nwords ( const char *  s)

how many words in s? nondestructive, assumes s is strip()ed

void Pol::Clib::open_file ( std::ofstream &  ofs,
std::string &  filename,
std::ios::openmode  mode 
)

Definition at line 29 of file iohelp.cpp.

void Pol::Clib::open_file ( std::ifstream &  ifs,
std::string &  filename,
std::ios::openmode  mode 
)

Definition at line 42 of file iohelp.cpp.

POL_NORETURN void Pol::Clib::passert_failed ( const char *  expr,
const char *  file,
unsigned  line 
)

Definition at line 65 of file passert.cpp.

POL_NORETURN void Pol::Clib::passert_failed ( const char *  expr,
const std::string &  reason,
const char *  file,
unsigned  line 
)
void Pol::Clib::PrintHeapData ( )
double Pol::Clib::random_double ( double  f)
int Pol::Clib::random_int_range ( int  minI,
int  maxI 
)

Definition at line 43 of file random.cpp.

Referenced by Pol::Module::UtilExecutorModule::mf_RandomIntMinMax().

bool Pol::Clib::readline ( Socket sck,
std::string &  s,
bool *  timeout_exit,
unsigned int  timeout_secs,
unsigned  maxlen 
)
bool Pol::Clib::readstring ( Socket sck,
std::string &  s,
unsigned int  interchar_secs,
unsigned  length 
)
void Pol::Clib::RemoveFile ( const std::string &  fname)
template<typename T >
void Pol::Clib::sanitize_bounds ( T *  value,
const T  min,
const T  max 
)

Definition at line 113 of file clib.h.

template<typename T >
void Pol::Clib::sanitize_lowerlimit ( T *  value,
const T  min 
)

Definition at line 107 of file clib.h.

template<typename T >
void Pol::Clib::sanitize_upperlimit ( T *  value,
const T  max 
)
char * Pol::Clib::stracpy ( char *  dest,
const char *  src,
size_t  maxlen 
)

make an always null terminated string in maxlen characters

Definition at line 17 of file stracpy.cpp.

Referenced by Pol::Bscript::SmartParser::IIP(), and Pol::Bscript::Compiler::readCurLine().

template<class S1 , class S2 >
int Pol::Clib::stringicmp ( const S1 &  str1,
const S2 &  str2 
)
inline
template<class S1 , const char * >
int Pol::Clib::stringicmp ( const S1 &  str1,
const char *  str2 
)
inline

Definition at line 55 of file stlutil.h.

template<const char * , class S2 >
int Pol::Clib::stringicmp ( const char *  str1,
const S2 &  str2 
)
inline

Definition at line 64 of file stlutil.h.

char* Pol::Clib::strip ( char *  s)
int Pol::Clib::strip_one ( std::string &  direc)
char* Pol::Clib::strpcpy ( char *  dest,
const char *  src,
size_t  maxlen 
)

make a space-padded string

void Pol::Clib::test_convertquotedstring ( )

Definition at line 256 of file strutil.cpp.

References test_convertquotedstring_obj, and test_dqs().

void Pol::Clib::test_dqs ( const std::string &  in,
const std::string &  out 
)

Definition at line 241 of file strutil.cpp.

References decodequotedstring(), encodequotedstring(), and INFO_PRINT.

Referenced by test_convertquotedstring().

void Pol::Clib::test_splitnamevalue ( const std::string &  istr,
const std::string &  exp_pn,
const std::string &  exp_pv 
)

Definition at line 140 of file strutil.cpp.

References INFO_PRINT, and splitnamevalue().

Referenced by test_splitnamevalue().

void Pol::Clib::test_splitnamevalue ( )

Definition at line 151 of file strutil.cpp.

References test_splitnamevalue(), and test_splitnamevalue_obj.

template<>
std::string Pol::Clib::tostring ( const Bscript::BTokenId v)

Template specialization for outputting the token ID

Definition at line 28 of file tokens.cpp.

References tostring().

template<class T >
std::string Pol::Clib::tostring ( const T &  v)

Definition at line 79 of file stlutil.h.

References OSTRINGSTREAM, and OSTRINGSTREAM_STR.

wallclock_t Pol::Clib::wallclock ( )

Definition at line 31 of file wallclock.cpp.

Referenced by Pol::Network::Client::SpeedHackPrevention().

wallclock_diff_t Pol::Clib::wallclock_diff_ms ( wallclock_t  start,
wallclock_t  finish 
)

Definition at line 38 of file wallclock.cpp.

Referenced by Pol::Network::Client::SpeedHackPrevention().

void Pol::Clib::writeline ( Socket sck,
const std::string &  s 
)

Variable Documentation

unsigned int Pol::Clib::blocks_allocated = 0
static

Definition at line 34 of file opnew.cpp.

Referenced by PrintHeapData().

unsigned int Pol::Clib::bytes_allocated = 0
static

Definition at line 32 of file opnew.cpp.

Referenced by PrintHeapData().

const unsigned Pol::Clib::CST_MANDATORY = 1

Definition at line 20 of file cfgsect.h.

Referenced by Pol::Clib::ConfigSection::~ConfigSection().

const unsigned Pol::Clib::CST_NORMAL = 0
const unsigned Pol::Clib::CST_UNIQUE = 2

Definition at line 21 of file cfgsect.h.

Referenced by Pol::Clib::ConfigSection::matches(), and Pol::Core::read_guilds_dat().

const std::size_t Pol::Clib::flush_limit = 10000

Definition at line 12 of file streamsaver.cpp.

Referenced by Pol::Clib::StreamWriter::operator()().

Pathname Pol::Clib::fullpath2
static

Definition at line 73 of file dirfunc.cpp.

Referenced by buildfn(), buildfnext(), and nodefile().

MSJExceptionHandler Pol::Clib::g_MSJExceptionHandler

Definition at line 48 of file msjexhnd.cpp.

HMODULE Pol::Clib::hDbgHelpDll

Definition at line 74 of file mdump.cpp.

unsigned int Pol::Clib::last_blocks_allocated = 0
static

Definition at line 35 of file opnew.cpp.

Referenced by PrintHeapData().

unsigned int Pol::Clib::last_bytes_allocated = 0
static

Definition at line 33 of file opnew.cpp.

Referenced by PrintHeapData().

bool Pol::Clib::LogfileTimestampEveryLine = false
int Pol::Clib::mydir_errno

Definition at line 169 of file dirfunc.cpp.

bool Pol::Clib::passert_abort = true

Definition at line 32 of file passert.cpp.

Referenced by Pol::Core::PolConfig::read_pol_config().

bool Pol::Clib::passert_dump_stack = false

Definition at line 30 of file passert.cpp.

Referenced by Pol::Core::PolConfig::read_pol_config().

bool Pol::Clib::passert_nosave = false
bool Pol::Clib::passert_shutdown = false

Definition at line 31 of file passert.cpp.

Referenced by Pol::Core::PolConfig::read_pol_config().

bool Pol::Clib::passert_shutdown_due_to_assertion = false

Definition at line 34 of file passert.cpp.

Referenced by Pol::Core::should_write_data(), and Pol::xmain_inner().

char Pol::Clib::temp_dir

Definition at line 30 of file dirfunc.cpp.

char Pol::Clib::temp_drive

Definition at line 29 of file dirfunc.cpp.

char Pol::Clib::temp_ext

Definition at line 32 of file dirfunc.cpp.

char Pol::Clib::temp_fname

Definition at line 31 of file dirfunc.cpp.

char Pol::Clib::temp_path

Definition at line 28 of file dirfunc.cpp.

UnitTest Pol::Clib::test_convertquotedstring_obj(test_convertquotedstring)
UnitTest Pol::Clib::test_splitnamevalue_obj(test_splitnamevalue)

Referenced by test_splitnamevalue().

TraceBufferElem Pol::Clib::tracebuffer

Definition at line 19 of file tracebuf.cpp.

unsigned Pol::Clib::tracebuffer_insertpoint

Definition at line 20 of file tracebuf.cpp.

Referenced by _tracebuffer_addelem(), and LogTraceBuffer().

Pathname Pol::Clib::workspace2
static

Definition at line 73 of file dirfunc.cpp.