Utilities Class Reference

#include <Utilities.hpp>

Static Public Member Functions

static int strCaselessCompare (const char *opt1, const char *opt2)
 
static int memicmp (const void *opt1, const void *opt2, size_t len)
 
static void strupper (char *str)
 
static void strlower (char *str)
 
static const char * strnchr (const char *, size_t n, char ch)
 
static const char * locateCharacter (const char *s, const char *set, size_t l)
 
static int vsnprintf (char *buffer, size_t count, const char *format, va_list args)
 
static int snprintf (char *buffer, size_t count, const char *format,...)
 
static wholenumber_t currentThreadId ()
 
static void traceConcurrency (bool)
 
static bool traceConcurrency ()
 
static void traceParsing (bool)
 
static bool traceParsing ()
 
static void SetConcurrencyInfosCollector (ConcurrencyInfosCollector)
 
static void GetConcurrencyInfos (struct ConcurrencyInfos &concurrencyInfos)
 

Detailed Description

Definition at line 75 of file Utilities.hpp.

Member Function Documentation

◆ currentThreadId()

wholenumber_t Utilities::currentThreadId ( )
static

Definition at line 124 of file unix/SysUtilities.cpp.

Referenced by GetConcurrencyInfos(), and APIServer::processMessages().

◆ GetConcurrencyInfos()

◆ locateCharacter()

const char * Utilities::locateCharacter ( const char *  s,
const char *  set,
size_t  l 
)
static

Definition at line 72 of file Utilities.cpp.

Referenced by RexxSource::initBuffered().

◆ memicmp()

int Utilities::memicmp ( const void *  mem1,
const void *  mem2,
size_t  len 
)
static

Portable implementation of a caseless memory compare.

Parameters
opt1First memory location to compare.
opt2Second memory location.
lenLength to compare.
Returns
The compare result. Returns 0, negative, or positive depending one the ordering compare result.

Definition at line 127 of file Utilities.cpp.

Referenced by StreamToken::equals().

◆ SetConcurrencyInfosCollector()

void Utilities::SetConcurrencyInfosCollector ( ConcurrencyInfosCollector  collector)
static

◆ snprintf()

int Utilities::snprintf ( char *  buffer,
size_t  count,
const char *  format,
  ... 
)
static

Encapsulation of snprintf Unix implementation. The goal is to have the same behavior on all platforms.

Parameters
bufferBuffer receiving the formated output.
sizeSize of buffer.
formatFormat string.
...Optional arguments
Returns
Upon successful completion, return the number of bytes stored in buffer, not counting the terminating null character or a negative value if an error was encountered.

Encapsulation of snprintf Windows implementation. The goal is to have the same behavior on all platforms.

Parameters
bufferBuffer receiving the formated output.
sizeSize of buffer.
formatFormat string.
...Optional arguments
Returns
Upon successful completion, return the number of bytes stored in buffer, not counting the terminating null character or a negative value if an error was encountered.

Definition at line 113 of file unix/SysUtilities.cpp.

References vsnprintf().

Referenced by RexxToken::codeText(), RexxToken::keywordText(), nameCollision(), and RexxActivity::traceOutput().

◆ strCaselessCompare()

int Utilities::strCaselessCompare ( const char *  op1,
const char *  op2 
)
static

Portable implementation of an ascii-z caseless string compare.

Parameters
opt1First string argument
opt2Second string argument.
Returns
The compare result. Returns 0, negative, or positive depending one the ordering compare result.

Definition at line 102 of file Utilities.cpp.

Referenced by RexxObject::defMethod(), RexxSource::initFile(), NameTable::inTable(), LocalQueueManager::isSessionQueue(), MacroTable::locate(), QueueTable::locate(), RegistrationData::matches(), StreamInfo::openStd(), MacroTable::remove(), QueueTable::remove(), RexxObject::setMethod(), RexxString::strCaselessCompare(), systemCommandHandler(), traceConcurrency(), traceParsing(), and LocalQueueManager::validateQueueName().

◆ strlower()

void Utilities::strlower ( char *  str)
static

Portable implementation of an ascii-z string to uppercase (in place).

Parameters
strString argument
Returns
The address of the str unput argument.

Definition at line 171 of file Utilities.cpp.

Referenced by SysFileSystem::primitiveSearchName().

◆ strnchr()

const char * Utilities::strnchr ( const char *  data,
size_t  n,
char  ch 
)
static

Bounded strchr() function.

Parameters
dataThe data pointer.
nThe maximum length to scan.
chThe character of interest.
Returns
The pointer to the located character, or NULL if it isn't found.

Definition at line 192 of file Utilities.cpp.

Referenced by RoutineClass::restore().

◆ strupper()

void Utilities::strupper ( char *  str)
static

Portable implementation of an ascii-z string to uppercase (in place).

Parameters
strString argument
Returns
The address of the str unput argument.

Definition at line 152 of file Utilities.cpp.

Referenced by hasNoBufferOption(), and LocalRegistrationManager::resolveCallback().

◆ traceConcurrency() [1/2]

◆ traceConcurrency() [2/2]

void Utilities::traceConcurrency ( bool  trace)
static

Definition at line 133 of file unix/SysUtilities.cpp.

References TRACE_CONCURRENCY.

◆ traceParsing() [1/2]

bool Utilities::traceParsing ( )
static

◆ traceParsing() [2/2]

void Utilities::traceParsing ( bool  trace)
static

Definition at line 165 of file unix/SysUtilities.cpp.

References TRACE_PARSING.

◆ vsnprintf()

int Utilities::vsnprintf ( char *  buffer,
size_t  count,
const char *  format,
va_list  args 
)
static

Encapsulation of vsnprintf Unix implementation. The goal is to have the same behavior on all platforms.

Parameters
bufferBuffer receiving the formated output.
sizeSize of buffer.
formatFormat string.
argsPointer to optional arguments
Returns
Upon successful completion, return the number of bytes stored in buffer, not counting the terminating null character or a negative value if an error was encountered.

Encapsulation of _vsnprintf Windows implementation. The goal is to have the same behavior on all platforms.

Parameters
bufferBuffer receiving the formated output.
sizeSize of buffer.
formatFormat string.
argsPointer to optional arguments
Returns
Upon successful completion, return the number of bytes stored in buffer, not counting the terminating null character or a negative value if an error was encountered.

Definition at line 60 of file unix/SysUtilities.cpp.

Referenced by rsnprintf(), and snprintf().


The documentation for this class was generated from the following files: