|
WizardsToolkit
1.0.7
|
#include "wizard/studio.h"#include "wizard/blob.h"#include "wizard/client.h"#include "wizard/configure.h"#include "wizard/exception.h"#include "wizard/exception-private.h"#include "wizard/hashmap.h"#include "wizard/log.h"#include "wizard/memory_.h"#include "wizard/option.h"#include "wizard/semaphore.h"#include "wizard/string_.h"#include "wizard/string-private.h"#include "wizard/thread_.h"#include "wizard/thread-private.h"#include "wizard/timer.h"#include "wizard/token.h"#include "wizard/utility.h"#include "wizard/utility-private.h"#include "wizard/version.h"#include "wizard/xml-tree.h"
Go to the source code of this file.
Data Structures | |
| struct | _EventInfo |
| struct | _HandlerInfo |
| struct | _LogInfo |
| struct | _LogMapInfo |
Defines | |
| #define | LogFilename "log.xml" |
| #define | MegabytesToBytes(value) ((WizardSizeType) (value)*1024*1024) |
Typedefs | |
| typedef struct _EventInfo | EventInfo |
| typedef struct _HandlerInfo | HandlerInfo |
| typedef struct _LogMapInfo | LogMapInfo |
Enumerations | |
| enum | LogHandlerType { UndefinedHandler = 0x0000, NoHandler = 0x0000, ConsoleHandler = 0x0001, StdoutHandler = 0x0002, StderrHandler = 0x0004, FileHandler = 0x0008, DebugHandler = 0x0010, EventHandler = 0x0020 } |
Functions | |
| static LogHandlerType | ParseLogHandlers (const char *) |
| static WizardBooleanType | InitializeLogList (ExceptionInfo *) |
| static WizardBooleanType | LoadLogLists (const char *, ExceptionInfo *) |
| WizardExport void | CloseWizardLog (void) |
| WizardExport const LogInfo * | GetLogInfo (const char *name, ExceptionInfo *exception) |
| static int | LogInfoCompare (const void *x, const void *y) |
| WizardExport const LogInfo ** | GetLogInfoList (const char *pattern, size_t *number_preferences, ExceptionInfo *exception) |
| static int | LogCompare (const void *x, const void *y) |
| WizardExport char ** | GetLogList (const char *pattern, size_t *number_preferences, ExceptionInfo *exception) |
| WizardExport const char * | GetLogName (void) |
| WizardExport WizardBooleanType | IsEventLogging (void) |
| WizardExport WizardBooleanType | ListLogInfo (FILE *file, ExceptionInfo *exception) |
| WizardExport WizardBooleanType | LogComponentGenesis (void) |
| static void * | DestroyLogElement (void *log_info) |
| WizardExport void | LogComponentTerminus (void) |
| static char * | TranslateEvent (const LogEventType wizard_unused(type), const char *module, const char *function, const size_t line, const char *domain, const char *event) |
| static char * | TranslateFilename (const LogInfo *log_info) |
| WizardBooleanType | LogWizardEventList (const LogEventType type, const char *module, const char *function, const size_t line, const char *format, va_list operands) |
| WizardBooleanType | LogWizardEvent (const LogEventType type, const char *module, const char *function, const size_t line, const char *format,...) |
| static WizardBooleanType | LoadLogList (const char *xml, const char *filename, const size_t depth, ExceptionInfo *exception) |
| WizardExport LogEventType | SetLogEventMask (const char *events) |
| WizardExport void | SetLogFormat (const char *format) |
| WizardExport const char * | SetLogName (const char *name) |
Variables | |
| static const HandlerInfo | LogHandlers [] |
| static const LogMapInfo | LogMap [] |
| static char | log_name [MaxTextExtent] = "Wizard" |
| static LinkedListInfo * | log_list = (LinkedListInfo *) NULL |
| static SemaphoreInfo * | log_semaphore = (SemaphoreInfo *) NULL |
| static volatile WizardBooleanType | instantiate_log = WizardFalse |
| #define LogFilename "log.xml" |
Definition at line 67 of file log.c.
Referenced by InitializeLogList().
| #define MegabytesToBytes | ( | value | ) | ((WizardSizeType) (value)*1024*1024) |
Referenced by ListLogInfo().
| typedef struct _EventInfo EventInfo |
| typedef struct _HandlerInfo HandlerInfo |
| typedef struct _LogMapInfo LogMapInfo |
| enum LogHandlerType |
| WizardExport void CloseWizardLog | ( | void | ) |
Definition at line 217 of file log.c.
References IsEventLogging(), WizardFalse, AcquireExceptionInfo(), GetLogInfo(), DestroyExceptionInfo(), LockSemaphoreInfo(), log_semaphore, _LogInfo::file, _LogInfo::append, and UnlockSemaphoreInfo().
| static void* DestroyLogElement | ( | void * | log_info | ) | [static] |
Definition at line 717 of file log.c.
References _LogInfo::file, _LogInfo::append, WizardFalse, _LogInfo::exempt, _LogInfo::format, DestroyString(), _LogInfo::filename, _LogInfo::path, _LogInfo::timer, DestroyTimerInfo(), and RelinquishWizardMemory().
Referenced by LogComponentTerminus().
| WizardExport const LogInfo* GetLogInfo | ( | const char * | name, |
| ExceptionInfo * | exception | ||
| ) |
Definition at line 266 of file log.c.
References log_list, instantiate_log, WizardFalse, InitializeLogList(), IsLinkedListEmpty(), LocaleCompare(), GetValueFromLinkedList(), LockSemaphoreInfo(), log_semaphore, ResetLinkedListIterator(), GetNextValueInLinkedList(), _LogInfo::name, ThrowWizardException(), GetWizardModule, OptionWarning, InsertValueInLinkedList(), RemoveElementByValueFromLinkedList(), and UnlockSemaphoreInfo().
Referenced by CloseWizardLog(), GetLogInfoList(), GetLogList(), IsEventLogging(), TranslateEvent(), LogWizardEventList(), SetLogEventMask(), and SetLogFormat().
| WizardExport const LogInfo** GetLogInfoList | ( | const char * | pattern, |
| size_t * | number_preferences, | ||
| ExceptionInfo * | exception | ||
| ) |
Definition at line 351 of file log.c.
References LogWizardEvent(), TraceEvent, GetWizardModule, GetLogInfo(), AcquireQuantumMemory(), GetNumberOfElementsInLinkedList(), log_list, LockSemaphoreInfo(), log_semaphore, ResetLinkedListIterator(), GetNextValueInLinkedList(), _LogInfo::stealth, WizardFalse, GlobExpression(), _LogInfo::name, UnlockSemaphoreInfo(), and LogInfoCompare().
Referenced by ListLogInfo().
| WizardExport char** GetLogList | ( | const char * | pattern, |
| size_t * | number_preferences, | ||
| ExceptionInfo * | exception | ||
| ) |
Definition at line 444 of file log.c.
References LogWizardEvent(), TraceEvent, GetWizardModule, GetLogInfo(), AcquireQuantumMemory(), GetNumberOfElementsInLinkedList(), log_list, LockSemaphoreInfo(), log_semaphore, ResetLinkedListIterator(), GetNextValueInLinkedList(), _LogInfo::stealth, WizardFalse, GlobExpression(), _LogInfo::name, ConstantString(), UnlockSemaphoreInfo(), and LogCompare().
| WizardExport const char* GetLogName | ( | void | ) |
Definition at line 508 of file log.c.
References log_name.
Referenced by TranslateEvent(), and TranslateFilename().
| static WizardBooleanType InitializeLogList | ( | ExceptionInfo * | exception | ) | [static] |
Definition at line 535 of file log.c.
References log_list, instantiate_log, WizardFalse, log_semaphore, AcquireSemaphoreInfo(), LockSemaphoreInfo(), LoadLogLists(), LogFilename, WizardTrue, and UnlockSemaphoreInfo().
Referenced by GetLogInfo().
| WizardExport WizardBooleanType IsEventLogging | ( | void | ) |
Definition at line 572 of file log.c.
References log_list, IsLinkedListEmpty(), WizardFalse, AcquireExceptionInfo(), GetLogInfo(), DestroyExceptionInfo(), _LogInfo::event_mask, NoEvents, and WizardTrue.
Referenced by GetBlobInfo(), NewHashmap(), CloseWizardLog(), LogWizardEventList(), NewSplayTree(), WizardsToolkitGenesis(), AddChildToXMLTree(), and NewXMLTreeTag().
| WizardExport WizardBooleanType ListLogInfo | ( | FILE * | file, |
| ExceptionInfo * | exception | ||
| ) |
Definition at line 612 of file log.c.
References MaxTextExtent, GetLogInfoList(), WizardFalse, LocaleCompare(), _LogInfo::path, _LogInfo::generations, FormatWizardSize(), MegabytesToBytes, RelinquishWizardMemory(), and WizardTrue.
| static WizardBooleanType LoadLogList | ( | const char * | xml, |
| const char * | filename, | ||
| const size_t | depth, | ||
| ExceptionInfo * | exception | ||
| ) | [static] |
Definition at line 1282 of file log.c.
References MaxTextExtent, WizardFalse, log_list, NewLinkedList(), ThrowWizardException(), GetWizardModule, ConfigureError, WizardTrue, AcquireString(), GetWizardToken(), CopyWizardString(), LocaleNCompare(), LocaleCompare(), GetPathComponent(), HeadPath, ConcatenateWizardString(), DirectorySeparator, FileToString(), DestroyString(), AcquireWizardMemory(), ThrowFatalException, ResourceFatalError, ResetWizardMemory(), _LogInfo::path, ConstantString(), _LogInfo::timer, AcquireTimerInfo(), _LogInfo::exempt, _LogInfo::signature, WizardSignature, AppendValueToLinkedList(), ResourceError, _LogInfo::event_mask, ParseWizardOption(), WizardLogEventOptions, _LogInfo::filename, RelinquishWizardMemory(), _LogInfo::format, _LogInfo::generations, StringToUnsignedLong(), _LogInfo::limit, _LogInfo::handler_mask, and ParseLogHandlers().
Referenced by LoadLogLists().
| static WizardBooleanType LoadLogLists | ( | const char * | filename, |
| ExceptionInfo * | exception | ||
| ) |
Definition at line 1527 of file log.c.
References WizardFalse, log_list, NewLinkedList(), ThrowFileException, FileError, LogMap, AcquireWizardMemory(), ThrowWizardException(), GetWizardModule, ResourceError, _LogInfo::name, ResetWizardMemory(), _LogInfo::path, _LogInfo::timer, AcquireTimerInfo(), _LogInfo::event_mask, _LogMapInfo::event_mask, _LogInfo::handler_mask, _LogMapInfo::handler_mask, _LogInfo::filename, ConstantString(), _LogMapInfo::filename, _LogInfo::format, _LogMapInfo::format, _LogInfo::exempt, WizardTrue, _LogInfo::signature, WizardSignature, AppendValueToLinkedList(), GetConfigureOptions(), GetNextValueInLinkedList(), LoadLogList(), GetStringInfoDatum(), GetStringInfoPath(), and DestroyConfigureOptions().
Referenced by InitializeLogList().
| static int LogCompare | ( | const void * | x, |
| const void * | y | ||
| ) | [static] |
| WizardExport WizardBooleanType LogComponentGenesis | ( | void | ) |
Definition at line 692 of file log.c.
References AcquireSemaphoreInfo(), log_semaphore, and WizardTrue.
Referenced by WizardsToolkitGenesis().
| WizardExport void LogComponentTerminus | ( | void | ) |
Definition at line 745 of file log.c.
References log_semaphore, AcquireSemaphoreInfo(), LockSemaphoreInfo(), log_list, DestroyLinkedList(), DestroyLogElement(), instantiate_log, WizardFalse, UnlockSemaphoreInfo(), and DestroySemaphoreInfo().
Referenced by WizardsToolkitTerminus().
| static int LogInfoCompare | ( | const void * | x, |
| const void * | y | ||
| ) | [static] |
| WizardBooleanType LogWizardEvent | ( | const LogEventType | type, |
| const char * | module, | ||
| const char * | function, | ||
| const size_t | line, | ||
| const char * | format, | ||
| ... | |||
| ) |
Definition at line 1237 of file log.c.
References LogWizardEventList().
Referenced by DestroyAESInfo(), GetAESBlocksize(), SetAESKey(), AuthenticateKey(), DestroyAuthenticateInfo(), GenerateAuthenticateKey(), GetAuthenticateId(), GetAuthenticateKey(), GetAuthenticateKeyLength(), GetAuthenticatePassphrase(), SetAuthenticateId(), SetAuthenticateKeyLength(), SetAuthenticatePassphrase(), AttachBlob(), CloseBlob(), DestroyBlob(), DetachBlob(), EOFBlob(), FileToBlob(), GetBlobFilename(), GetBlobSize(), GetBlobProperties(), OpenBlob(), SyncBlob(), TellBlob(), DestroyBZIPInfo(), GetBZIPChaos(), IncreaseBZIP(), RestoreBZIP(), DecipherCBCMode(), DecipherCFBMode(), DecipherCipher(), DecipherCTRMode(), DecipherECBMode(), DecipherOFBMode(), DestroyCipherInfo(), EncipherCBCMode(), EncipherCFBMode(), EncipherCipher(), EncipherCTRMode(), EncipherECBMode(), EncipherOFBMode(), GetCipherBlocksize(), GenerateCipherNonce(), GetCipherNonce(), ResetCipherNonce(), SetCipherNonce(), SetCipherKey(), DestroyConfigureOptions(), GetConfigureInfoList(), GetConfigureList(), GetConfigureOptions(), GetConfigurePaths(), GetConfigureValue(), LoadConfigureList(), DestroyCRC64Info(), FinalizeCRC64(), GetCRC64Blocksize(), GetCRC64CyclicRedundancyCheck(), GetCRC64Digest(), GetCRC64Digestsize(), InitializeCRC64(), UpdateCRC64(), DestroyEntropyInfo(), GetEntropyChaos(), IncreaseEntropy(), RestoreEntropy(), ThrowWizardExceptionList(), AcquireFileLock(), AcquireFileInfo(), DestroyFileInfo(), GetFileDescriptor(), GetFilePath(), GetFileProperties(), ReadFileChunk(), WriteFileChunk(), WriteFile32Bits(), WriteFile64Bits(), DestroyHashInfo(), FinalizeHash(), GetHashBlocksize(), GetHashDigest(), GetHashDigestsize(), GetHashHexDigest(), InitializeHash(), UpdateHash(), AppendValueToLinkedList(), ClearLinkedList(), DestroyHashmap(), DestroyLinkedList(), GetLastValueInLinkedList(), GetNextKeyInHashmap(), GetNextValueInHashmap(), GetNextValueInLinkedList(), GetNumberOfEntriesInHashmap(), GetNumberOfElementsInLinkedList(), GetValueFromHashmap(), GetValueFromLinkedList(), InsertValueInLinkedList(), InsertValueInSortedLinkedList(), IsHashmapEmpty(), IsLinkedListEmpty(), LinkedListToArray(), PutEntryInHashmap(), RemoveElementByValueFromLinkedList(), RemoveElementFromLinkedList(), RemoveEntryFromHashmap(), RemoveLastElementFromLinkedList(), ResetHashmapIterator(), ResetLinkedListIterator(), ConstructHMAC(), DestroyHMACInfo(), FinalizeHMAC(), GetHMACDigest(), GetHMACDigestsize(), InitializeHMAC(), ResetHMAC(), UpdateHMAC(), DestroyKeyInfo(), GenerateSessionKey(), GetKeyInfo(), SetKeyInfo(), DestroyKeyringInfo(), ExportKeyringKey(), GetKeyringKey(), GetKeyringNonce(), ImportKeyringKey(), PrintKeyringProperties(), GetLogInfoList(), GetLogList(), GetLZMAChaos(), DestroyLZMAInfo(), IncreaseLZMA(), RestoreLZMA(), DestroyMD5Info(), FinalizeMD5(), GetMD5Blocksize(), GetMD5Digest(), GetMD5Digestsize(), InitializeMD5(), GetMimeInfoList(), GetMimeList(), GetMimeDescription(), GetMimeType(), LoadMimeList(), DestroyRandomInfo(), GetEntropyFromReservoir(), SaveEntropyToReservoir(), AcquireUniqueFileResource(), AcquireWizardResource(), RelinquishWizardResource(), RelinquishUniqueFileResource(), AuthenticateSecretKey(), DestroySecretInfo(), GenerateSecretKey(), GetSecretId(), GetSecretKey(), GetSecretKeyLength(), GetSecretPassphrase(), SetSecretKeyLength(), DestroySerpentInfo(), GetSerpentBlocksize(), SetSerpentKey(), DestroySHA1Info(), FinalizeSHA1(), GetSHA1Blocksize(), GetSHA1Digest(), GetSHA1Digestsize(), InitializeSHA1(), DestroySHA224Info(), FinalizeSHA224(), GetSHA224Blocksize(), GetSHA224Digest(), GetSHA224Digestsize(), InitializeSHA224(), DestroySHA256Info(), FinalizeSHA256(), GetSHA256Blocksize(), GetSHA256Digest(), GetSHA256Digestsize(), InitializeSHA256(), DestroySHA384Info(), FinalizeSHA384(), GetSHA384Blocksize(), GetSHA384Digest(), GetSHA384Digestsize(), InitializeSHA384(), DestroySHA512Info(), FinalizeSHA512(), GetSHA512Blocksize(), GetSHA512Digest(), GetSHA512Digestsize(), InitializeSHA512(), CloneSplayTree(), DeleteNodeByValueFromSplayTree(), DeleteNodeFromSplayTree(), GetNextKeyInSplayTree(), GetNextValueInSplayTree(), GetValueFromSplayTree(), GetNumberOfNodesInSplayTree(), RemoveNodeByValueFromSplayTree(), RemoveNodeFromSplayTree(), ResetSplayTree(), ResetSplayTreeIterator(), CloneString(), CloneStringInfo(), CompareStringInfo(), ConcatenateStringInfo(), DestroyStringInfo(), FileToString(), FileToStringInfo(), GetStringInfoCRC(), HexStringToStringInfo(), PrintStringInfo(), ResetStringInfo(), SetStringInfo(), SetStringInfoDatum(), SetStringInfoLength(), SetStringInfoPath(), SplitStringInfo(), StringToStringInfo(), DestroyTwofishInfo(), GetTwofishBlocksize(), SetTwofishKey(), AppendFileExtension(), Base64Decode(), Base64Encode(), GetPathComponent(), RegisterWizardSignalHandler(), AddPathToXMLTree(), DestroyXMLTree(), GetNextXMLTreeTag(), GetXMLTreeAttribute(), GetXMLTreeAttributes(), GetXMLTreeChild(), GetXMLTreeContent(), GetXMLTreeOrdered(), GetXMLTreePath(), GetXMLTreeProcessingInstructions(), GetXMLTreeSibling(), GetXMLTreeTag(), PruneTagFromXMLTree(), SetXMLTreeAttribute(), SetXMLTreeContent(), XMLTreeInfoToXML(), GetZIPChaos(), DestroyZIPInfo(), IncreaseZIP(), and RestoreZIP().
| WizardBooleanType LogWizardEventList | ( | const LogEventType | type, |
| const char * | module, | ||
| const char * | function, | ||
| const size_t | line, | ||
| const char * | format, | ||
| va_list | operands | ||
| ) |
Definition at line 1113 of file log.c.
References MaxTextExtent, IsEventLogging(), WizardFalse, AcquireExceptionInfo(), GetLogInfo(), DestroyExceptionInfo(), LockSemaphoreInfo(), log_semaphore, _LogInfo::event_mask, UnlockSemaphoreInfo(), WizardTrue, WizardOptionToMnemonic(), WizardLogEventOptions, vsnprintf, TranslateEvent(), ContinueTimer(), _LogInfo::timer, _LogInfo::handler_mask, ConsoleHandler, DebugHandler, EventHandler, NTReportEvent(), FileHandler, stat, _LogInfo::file, fstat, fileno, _LogInfo::limit, TranslateFilename(), _LogInfo::append, IsAccessible(), fopen_utf8(), RelinquishWizardMemory(), _LogInfo::generation, StdoutHandler, and StderrHandler.
Referenced by LogWizardEvent().
| static LogHandlerType ParseLogHandlers | ( | const char * | handlers | ) | [static] |
Definition at line 1623 of file log.c.
References NoHandler, LogHandlers, _HandlerInfo::name, LocaleNCompare(), and UndefinedHandler.
Referenced by LoadLogList().
| WizardExport LogEventType SetLogEventMask | ( | const char * | events | ) |
Definition at line 1682 of file log.c.
References AcquireExceptionInfo(), GetLogInfo(), DestroyExceptionInfo(), ParseWizardOption(), WizardLogEventOptions, WizardTrue, LockSemaphoreInfo(), log_semaphore, GetValueFromLinkedList(), log_list, _LogInfo::event_mask, UndefinedEvents, and UnlockSemaphoreInfo().
Referenced by WizardsToolkitGenesis().
| WizardExport void SetLogFormat | ( | const char * | format | ) |
Definition at line 1728 of file log.c.
References AcquireExceptionInfo(), GetLogInfo(), DestroyExceptionInfo(), LockSemaphoreInfo(), log_semaphore, _LogInfo::format, DestroyString(), ConstantString(), and UnlockSemaphoreInfo().
| WizardExport const char* SetLogName | ( | const char * | name | ) |
Definition at line 1770 of file log.c.
References CopyWizardString(), log_name, and MaxTextExtent.
| static char* TranslateEvent | ( | const LogEventType | wizard_unusedtype, |
| const char * | module, | ||
| const char * | function, | ||
| const size_t | line, | ||
| const char * | domain, | ||
| const char * | event | ||
| ) | [static] |
Definition at line 790 of file log.c.
References AcquireExceptionInfo(), GetLogInfo(), DestroyExceptionInfo(), GetElapsedTime(), _LogInfo::timer, GetUserTime(), AcquireString(), _LogInfo::format, MaxTextExtent, LocaleCompare(), FormatWizardTime(), FormatLocaleString(), getpid, GetWizardThreadSignature(), ResizeQuantumMemory(), CopyWizardString(), GetClientName(), _LogInfo::generations, _LogInfo::generation, DirectorySeparator, GetLogName(), and WizardLibVersionText.
Referenced by LogWizardEventList().
| static char* TranslateFilename | ( | const LogInfo * | log_info | ) | [static] |
Definition at line 1012 of file log.c.
References _LogInfo::filename, AcquireString(), MaxTextExtent, ResizeQuantumMemory(), CopyWizardString(), GetClientName(), _LogInfo::generations, FormatLocaleString(), _LogInfo::generation, GetLogName(), getpid, and WizardLibVersionText.
Referenced by LogWizardEventList().
volatile WizardBooleanType instantiate_log = WizardFalse [static] |
Definition at line 187 of file log.c.
Referenced by GetLogInfo(), InitializeLogList(), and LogComponentTerminus().
LinkedListInfo* log_list = (LinkedListInfo *) NULL [static] |
Definition at line 181 of file log.c.
Referenced by GetLogInfo(), GetLogInfoList(), GetLogList(), InitializeLogList(), IsEventLogging(), LogComponentTerminus(), LoadLogList(), LoadLogLists(), and SetLogEventMask().
char log_name[MaxTextExtent] = "Wizard" [static] |
Definition at line 178 of file log.c.
Referenced by GetLogName(), and SetLogName().
SemaphoreInfo* log_semaphore = (SemaphoreInfo *) NULL [static] |
Definition at line 184 of file log.c.
Referenced by CloseWizardLog(), GetLogInfo(), GetLogInfoList(), GetLogList(), InitializeLogList(), LogComponentGenesis(), LogComponentTerminus(), LogWizardEventList(), SetLogEventMask(), and SetLogFormat().
const HandlerInfo LogHandlers[] [static] |
{
{ "console", ConsoleHandler },
{ "debug", DebugHandler },
{ "event", EventHandler },
{ "file", FileHandler },
{ "none", NoHandler },
{ "stderr", StderrHandler },
{ "stdout", StdoutHandler },
{ (char *) NULL, UndefinedHandler }
}
Definition at line 142 of file log.c.
Referenced by ParseLogHandlers().
const LogMapInfo LogMap[] [static] |
{
{ NoEvents, ConsoleHandler, "Magick-%d.log",
"%t %r %u %v %d %c[%p]: %m/%f/%l/%d\n %e" }
}
Definition at line 171 of file log.c.
Referenced by LoadLogLists().