From f4c5af8017cfe42989c6104648e65b0011ae307b Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Thu, 21 Dec 2023 15:45:52 -0800 Subject: [PATCH] Update task, workflow and dictionary interfaces for DIRECT 7. --- dictionaryi.h | 147 ++--- docs/dictionary.md | 1491 +++++++++++++++++++++----------------------- docs/task.md | 152 +---- docs/workflow.md | 717 +++++++++++++++++++++ interoplib.c | 6 +- interoplib.h | 6 +- taski.h | 86 ++- workflowi.h | 10 +- 8 files changed, 1565 insertions(+), 1050 deletions(-) create mode 100644 docs/workflow.md diff --git a/dictionaryi.h b/dictionaryi.h index b372c79..15056f4 100644 --- a/dictionaryi.h +++ b/dictionaryi.h @@ -1,7 +1,5 @@ #pragma once -/*********************************************************************/ - #define IDICTIONARY_KEYRAW_MAX (120) #define IDICTIONARY_KEY_MAX (IDICTIONARY_KEYRAW_MAX - 1) #define IDICTIONARY_PATH_MAX (4096) @@ -9,8 +7,8 @@ #define IDICTIONARY_TYPE_UNKNOWN (0) #define IDICTIONARY_TYPE_NULL (1) #define IDICTIONARY_TYPE_BOOLEAN (2) -#define IDICTIONARY_TYPE_INT64 (3) -#define IDICTIONARY_TYPE_FLOAT64 (4) +#define IDICTIONARY_TYPE_INT (3) +#define IDICTIONARY_TYPE_FLOAT (4) #define IDICTIONARY_TYPE_STRING (5) #define IDICTIONARY_TYPE_LIST (6) #define IDICTIONARY_TYPE_DICTIONARY (7) @@ -39,13 +37,11 @@ typedef struct IDictionaryVtbl { bool (*Add)(echandle DictionaryHandle, const char *Key, echandle *ItemHandle); bool (*AddNull)(echandle DictionaryHandle, const char *Key, echandle *ItemHandle); bool (*AddString)(echandle DictionaryHandle, const char *Key, const char *Value, echandle *ItemHandle); - bool (*AddInt32)(echandle DictionaryHandle, const char *Key, int32_t Value, echandle *ItemHandle); - bool (*AddInt64)(echandle DictionaryHandle, const char *Key, int64_t Value, echandle *ItemHandle); - bool (*AddFloat64)(echandle DictionaryHandle, const char *Key, float64_t Value, echandle *ItemHandle); + bool (*AddInt)(echandle DictionaryHandle, const char *Key, int64_t Value, echandle *ItemHandle); + bool (*AddFloat)(echandle DictionaryHandle, const char *Key, float64_t Value, echandle *ItemHandle); bool (*AddBoolean)(echandle DictionaryHandle, const char *Key, bool Value, echandle *ItemHandle); bool (*AddList)(echandle DictionaryHandle, const char *Key, echandle *ListHandle, echandle *ItemHandle); bool (*AddDictionary)(echandle DictionaryHandle, const char *Key, echandle *DictHandle, echandle *ItemHandle); - bool (*Append)(echandle DictionaryHandle, const char *Key, echandle *ItemHandle); bool (*Insert)(echandle DictionaryHandle, echandle PrevItemHandle, const char *Key, echandle *ItemHandle); bool (*Remove)(echandle DictionaryHandle, echandle *ItemHandle); @@ -72,12 +68,11 @@ typedef struct IDictionaryVtbl { bool (*GetStringPtrByKey)(echandle DictionaryHandle, const char *Key, const char **StringPtr); bool (*GetBufferPtrByKey)(echandle DictionaryHandle, const char *Key, const char **BufferPtr, int32_t *BufferLength); - bool (*SetInt32ByKey)(echandle DictionaryHandle, const char *Key, int32_t Value); + bool (*SetIntByKey)(echandle DictionaryHandle, const char *Key, int64_t Value); bool (*GetInt32ByKey)(echandle DictionaryHandle, const char *Key, int32_t *Value); - bool (*SetInt64ByKey)(echandle DictionaryHandle, const char *Key, int64_t Value); bool (*GetInt64ByKey)(echandle DictionaryHandle, const char *Key, int64_t *Value); - bool (*SetFloat64ByKey)(echandle DictionaryHandle, const char *Key, float64_t Value); - bool (*GetFloat64ByKey)(echandle DictionaryHandle, const char *Key, float64_t *Value); + bool (*SetFloatByKey)(echandle DictionaryHandle, const char *Key, float64_t Value); + bool (*GetFloatByKey)(echandle DictionaryHandle, const char *Key, float64_t *Value); bool (*SetBooleanByKey)(echandle DictionaryHandle, const char *Key, bool Value); bool (*GetBooleanByKey)(echandle DictionaryHandle, const char *Key, bool *Value); bool (*GetListByIndex)(echandle DictionaryHandle, int32_t Index, echandle *ItemDictionaryHandle); @@ -92,7 +87,7 @@ typedef struct IDictionaryVtbl { bool (*ItemIsNull)(echandle DictionaryHandle, echandle ItemHandle); bool (*ItemGetIndex)(echandle DictionaryHandle, echandle ItemHandle, int32_t *Index); bool (*ItemSetType)(echandle DictionaryHandle, echandle ItemHandle, int32_t Type); - bool (*ItemGetType)(echandle DictionaryHandle, echandle ItemHandle, int32_t *Type); + int32_t (*ItemGetType)(echandle DictionaryHandle, echandle ItemHandle); bool (*ItemCompareType)(echandle DictionaryHandle, echandle ItemHandle, int32_t Type); bool (*ItemSetKey)(echandle DictionaryHandle, echandle ItemHandle, const char *Key); bool (*ItemSetKeyLength)(echandle DictionaryHandle, echandle ItemHandle, const char *Key, int32_t KeyLength); @@ -105,11 +100,10 @@ typedef struct IDictionaryVtbl { bool (*ItemSetBuffer)(echandle DictionaryHandle, echandle ItemHandle, const char *Buffer, int32_t BufferLength); bool (*ItemGetBufferPtr)(echandle DictionaryHandle, echandle ItemHandle, const char **BufferPtr, int32_t *BufferLength); - bool (*ItemSetFloat64)(echandle DictionaryHandle, echandle ItemHandle, float64_t Value); - bool (*ItemGetFloat64)(echandle DictionaryHandle, echandle ItemHandle, float64_t *Value); - bool (*ItemSetInt32)(echandle DictionaryHandle, echandle ItemHandle, int32_t Value); + bool (*ItemSetFloat)(echandle DictionaryHandle, echandle ItemHandle, float64_t Value); + bool (*ItemGetFloat)(echandle DictionaryHandle, echandle ItemHandle, float64_t *Value); + bool (*ItemSetInt)(echandle DictionaryHandle, echandle ItemHandle, int64_t Value); bool (*ItemGetInt32)(echandle DictionaryHandle, echandle ItemHandle, int32_t *Value); - bool (*ItemSetInt64)(echandle DictionaryHandle, echandle ItemHandle, int64_t Value); bool (*ItemGetInt64)(echandle DictionaryHandle, echandle ItemHandle, int64_t *Value); bool (*ItemSetBoolean)(echandle DictionaryHandle, echandle ItemHandle, bool Value); bool (*ItemGetBoolean)(echandle DictionaryHandle, echandle ItemHandle, bool *Value); @@ -125,7 +119,7 @@ typedef struct IDictionaryVtbl { bool (*ItemGetPrev)(echandle DictionaryHandle, echandle ItemHandle, echandle *PrevItemHandle); bool (*ItemGetFirst)(echandle DictionaryHandle, echandle *ItemHandle); bool (*ItemGetLast)(echandle DictionaryHandle, echandle *ItemHandle); - bool (*ItemGetCount)(echandle DictionaryHandle, int32_t *ItemCount); + int32_t (*ItemGetCount)(echandle DictionaryHandle); bool (*Log)(echandle DictionaryHandle, const char *Format, ...); bool (*LogTabbed)(echandle DictionaryHandle, int32_t Depth, const char *Format, ...); @@ -138,17 +132,17 @@ typedef struct IDictionaryVtbl { void *FilterUserPtr, IDictionary_ItemFilterCallback FilterCallback); bool (*RemoveMissing)(echandle TargetDictionaryHandle, echandle SourceDictionaryHandle); - bool (*Merge)(echandle TargetDictionaryHandle, echandle SourceDictionaryHandle, int32_t OverwriteExisting); + bool (*Merge)(echandle TargetDictionaryHandle, echandle SourceDictionaryHandle, int32_t Flags); bool (*MergeAt)(echandle TargetDictionaryHandle, echandle SourceDictionaryHandle, echandle SourceItemHandle, int32_t Flags); - bool (*SkipRoot)(echandle DictionaryHandle, echandle *DataDictionaryHandle); + echandle (*SkipRoot)(echandle DictionaryHandle); bool (*Reset)(echandle DictionaryHandle); bool (*Dump)(echandle DictionaryHandle); bool (*SetCaseSensitive)(echandle DictionaryHandle, bool CaseSensitive); - bool (*GetCaseSensitive)(echandle DictionaryHandle, bool *CaseSensitive); + bool (*GetCaseSensitive)(echandle DictionaryHandle); bool (*SetAllowDuplicates)(echandle DictionaryHandle, bool AllowDuplicates); - bool (*GetAllowDuplicates)(echandle DictionaryHandle, bool *AllowDuplicates); + bool (*GetAllowDuplicates)(echandle DictionaryHandle); bool (*SetItemRemoveCallback)(echandle DictionaryHandle, void *UserPtr, IDictionary_ItemRemoveCallback Callback); bool (*GetItemRemoveCallback)(echandle DictionaryHandle, void **UserPtr, IDictionary_ItemRemoveCallback *Callback); @@ -169,19 +163,18 @@ typedef struct IDictionaryVtbl { bool (*GetStringByPath)(echandle DictionaryHandle, const char *Path, char *String, int32_t MaxString); bool (*GetBufferPtrByPath)(echandle DictionaryHandle, const char *Path, const char **BufferPtr, int32_t *BufferLength); - bool (*SetInt32ByPath)(echandle DictionaryHandle, const char *Path, int32_t Value); + bool (*SetIntByPath)(echandle DictionaryHandle, const char *Path, int64_t Value); bool (*GetInt32ByPath)(echandle DictionaryHandle, const char *Path, int32_t *Value); - bool (*SetInt64ByPath)(echandle DictionaryHandle, const char *Path, int64_t Value); bool (*GetInt64ByPath)(echandle DictionaryHandle, const char *Path, int64_t *Value); - bool (*SetFloat64ByPath)(echandle DictionaryHandle, const char *Path, float64_t Value); - bool (*GetFloat64ByPath)(echandle DictionaryHandle, const char *Path, float64_t *Value); + bool (*SetFloatByPath)(echandle DictionaryHandle, const char *Path, float64_t Value); + bool (*GetFloatByPath)(echandle DictionaryHandle, const char *Path, float64_t *Value); bool (*SetBooleanByPath)(echandle DictionaryHandle, const char *Path, bool Value); bool (*GetBooleanByPath)(echandle DictionaryHandle, const char *Path, bool *Value); - bool (*SkipRootContainer)(echandle DictionaryHandle, echandle *DataDictionaryHandle); + echandle (*SkipRootContainer)(echandle DictionaryHandle); bool (*ItemSetPrivate)(echandle DictionaryHandle, echandle ItemHandle, bool Private); - bool (*ItemGetPrivate)(echandle DictionaryHandle, echandle ItemHandle, bool *Private); + bool (*ItemIsPrivate)(echandle DictionaryHandle, echandle ItemHandle); bool (*SetPrivateKeys)(echandle DictionaryHandle, bool PrivateKeys); - bool (*GetPrivateKeys)(echandle DictionaryHandle, bool *PrivateKeys); + bool (*GetPrivateKeys)(echandle DictionaryHandle); echandle (*AddRef)(echandle DictionaryHandle); int32_t (*Release)(echandle *DictionaryHandle); @@ -207,20 +200,16 @@ typedef struct IDictionaryVtbl { Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddNull(DictionaryHandle, Key, ItemHandle) #define IDictionary_AddString(DictionaryHandle, Key, Value, ItemHandle) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddString(DictionaryHandle, Key, Value, ItemHandle) -#define IDictionary_AddInt32(DictionaryHandle, Key, Value, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddInt32(DictionaryHandle, Key, Value, ItemHandle) -#define IDictionary_AddInt64(DictionaryHandle, Key, Value, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddInt64(DictionaryHandle, Key, Value, ItemHandle) -#define IDictionary_AddFloat64(DictionaryHandle, Key, Value, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddFloat64(DictionaryHandle, Key, Value, ItemHandle) +#define IDictionary_AddInt(DictionaryHandle, Key, Value, ItemHandle) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddInt(DictionaryHandle, Key, Value, ItemHandle) +#define IDictionary_AddFloat(DictionaryHandle, Key, Value, ItemHandle) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddFloat(DictionaryHandle, Key, Value, ItemHandle) #define IDictionary_AddBoolean(DictionaryHandle, Key, Value, ItemHandle) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddBoolean(DictionaryHandle, Key, Value, ItemHandle) #define IDictionary_AddList(DictionaryHandle, Key, ListHandle, ItemHandle) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddList(DictionaryHandle, Key, ListHandle, ItemHandle) #define IDictionary_AddDictionary(DictionaryHandle, Key, DictHandle, ItemHandle) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->AddDictionary(DictionaryHandle, Key, DictHandle, ItemHandle) -#define IDictionary_Append(DictionaryHandle, Key, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->Append(DictionaryHandle, Key, ItemHandle) #define IDictionary_Insert(DictionaryHandle, PrevItemHandle, Key, ItemHandle) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->Insert(DictionaryHandle, PrevItemHandle, Key, ItemHandle) #define IDictionary_Remove(DictionaryHandle, ItemHandle) \ @@ -281,30 +270,26 @@ typedef struct IDictionaryVtbl { #define IDictionary_GetBufferPtrByPath(DictionaryHandle, Path, BufferPtr, BufferLength) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ ->GetBufferPtrByPath(DictionaryHandle, Path, BufferPtr, BufferLength) -#define IDictionary_SetInt32ByKey(DictionaryHandle, Key, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetInt32ByKey(DictionaryHandle, Key, Value) -#define IDictionary_SetInt32ByPath(DictionaryHandle, Path, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetInt32ByPath(DictionaryHandle, Path, Value) +#define IDictionary_SetIntByKey(DictionaryHandle, Key, Value) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetIntByKey(DictionaryHandle, Key, Value) +#define IDictionary_SetIntByPath(DictionaryHandle, Path, Value) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetIntByPath(DictionaryHandle, Path, Value) #define IDictionary_GetInt32ByKey(DictionaryHandle, Key, Value) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetInt32ByKey(DictionaryHandle, Key, Value) #define IDictionary_GetInt32ByPath(DictionaryHandle, Path, Value) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetInt32ByPath(DictionaryHandle, Path, Value) -#define IDictionary_SetInt64ByKey(DictionaryHandle, Key, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetInt64ByKey(DictionaryHandle, Key, Value) -#define IDictionary_SetInt64ByPath(DictionaryHandle, Path, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetInt64ByPath(DictionaryHandle, Path, Value) #define IDictionary_GetInt64ByKey(DictionaryHandle, Key, Value) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetInt64ByKey(DictionaryHandle, Key, Value) #define IDictionary_GetInt64ByPath(DictionaryHandle, Key, Value) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetInt64ByPath(DictionaryHandle, Path, Value) -#define IDictionary_SetFloat64ByKey(DictionaryHandle, Key, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetFloat64ByKey(DictionaryHandle, Key, Value) -#define IDictionary_SetFloat64ByPath(DictionaryHandle, Path, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetFloat64ByPath(DictionaryHandle, Path, Value) -#define IDictionary_GetFloat64ByKey(DictionaryHandle, Key, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetFloat64ByKey(DictionaryHandle, Key, Value) -#define IDictionary_GetFloat64ByPath(DictionaryHandle, Path, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetFloat64ByPath(DictionaryHandle, Path, Value) +#define IDictionary_SetFloatByKey(DictionaryHandle, Path, Value) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetFloatByKey(DictionaryHandle, Key, Value) +#define IDictionary_SetFloatByPath(DictionaryHandle, Path, Value) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetFloatByPath(DictionaryHandle, Path, Value) +#define IDictionary_GetFloatByKey(DictionaryHandle, Key, Value) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetFloatByKey(DictionaryHandle, Key, Value) +#define IDictionary_GetFloatByPath(DictionaryHandle, Path, Value) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetFloatByPath(DictionaryHandle, Path, Value) #define IDictionary_SetBooleanByKey(DictionaryHandle, Key, Value) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetBooleanByKey(DictionaryHandle, Key, Value) #define IDictionary_SetBooleanByPath(DictionaryHandle, Path, Value) \ @@ -333,15 +318,15 @@ typedef struct IDictionaryVtbl { Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ ->ItemGetPath(DictionaryHandle, ItemHandle, TopDictionaryHandle, Path, MaxPath) #define IDictionary_ItemIsContainer(DictionaryHandle, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetPath(DictionaryHandle, ItemHandle) + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemIsContainer(DictionaryHandle, ItemHandle) #define IDictionary_ItemIsNull(DictionaryHandle, ItemHandle) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemIsNull(DictionaryHandle, ItemHandle) #define IDictionary_ItemGetIndex(DictionaryHandle, ItemHandle, Index) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetIndex(DictionaryHandle, ItemHandle, Index) #define IDictionary_ItemSetType(DictionaryHandle, ItemHandle, Type) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetType(DictionaryHandle, ItemHandle, Type) -#define IDictionary_ItemGetType(DictionaryHandle, ItemHandle, Type) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetType(DictionaryHandle, ItemHandle, Type) +#define IDictionary_ItemGetType(DictionaryHandle, ItemHandle) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetType(DictionaryHandle, ItemHandle) #define IDictionary_ItemCompareType(DictionaryHandle, ItemHandle, Type) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemCompareType(DictionaryHandle, ItemHandle, Type) #define IDictionary_ItemSetKey(DictionaryHandle, ItemHandle, Key) \ @@ -369,16 +354,14 @@ typedef struct IDictionaryVtbl { #define IDictionary_ItemGetBufferPtr(DictionaryHandle, ItemHandle, BufferPtr, BufferLength) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ ->ItemGetBufferPtr(DictionaryHandle, ItemHandle, BufferPtr, BufferLength) -#define IDictionary_ItemSetFloat64(DictionaryHandle, ItemHandle, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetFloat64(DictionaryHandle, ItemHandle, Value) -#define IDictionary_ItemGetFloat64(DictionaryHandle, ItemHandle, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetFloat64(DictionaryHandle, ItemHandle, Value) -#define IDictionary_ItemSetInt32(DictionaryHandle, ItemHandle, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetInt32(DictionaryHandle, ItemHandle, Value) +#define IDictionary_ItemSetFloat(DictionaryHandle, ItemHandle, Value) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetFloat(DictionaryHandle, ItemHandle, Value) +#define IDictionary_ItemGetFloat(DictionaryHandle, ItemHandle, Value) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetFloat(DictionaryHandle, ItemHandle, Value) +#define IDictionary_ItemSetInt(DictionaryHandle, ItemHandle, Value) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetInt(DictionaryHandle, ItemHandle, Value) #define IDictionary_ItemGetInt32(DictionaryHandle, ItemHandle, Value) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetInt32(DictionaryHandle, ItemHandle, Value) -#define IDictionary_ItemSetInt64(DictionaryHandle, ItemHandle, Value) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetInt64(DictionaryHandle, ItemHandle, Value) #define IDictionary_ItemGetInt64(DictionaryHandle, ItemHandle, Value) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetInt64(DictionaryHandle, ItemHandle, Value) #define IDictionary_ItemSetBoolean(DictionaryHandle, ItemHandle, Value) \ @@ -387,8 +370,8 @@ typedef struct IDictionaryVtbl { Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetBoolean(DictionaryHandle, ItemHandle, Value) #define IDictionary_ItemSetPrivate(DictionaryHandle, ItemHandle, Private) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetPrivate(DictionaryHandle, ItemHandle, Private) -#define IDictionary_ItemGetPrivate(DictionaryHandle, ItemHandle, Private) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetPrivate(DictionaryHandle, ItemHandle, Private) +#define IDictionary_ItemIsPrivate(DictionaryHandle, ItemHandle) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemIsPrivate(DictionaryHandle, ItemHandle) #define IDictionary_ItemSetNull(DictionaryHandle, ItemHandle) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemSetNull(DictionaryHandle, ItemHandle) #define IDictionary_ItemGetDictionaryHandle(DictionaryHandle, ItemHandle, DictHandle) \ @@ -401,9 +384,9 @@ typedef struct IDictionaryVtbl { #define IDictionary_ItemFindByBuffer(DictionaryHandle, Buffer, BufferLength, StartItemHandle, ItemHandle) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ ->ItemFindByBuffer(DictionaryHandle, Buffer, BufferLength, StartItemHandle, ItemHandle) -#define IDictionary_ItemFindByIndex(DictionaryHandle, Index, BufferLength, StartItemHandle, ItemHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ - ->ItemFindByIndex(DictionaryHandle, Index, BufferLength, StartItemHandle, ItemHandle) +#define IDictionary_ItemFindByIndex(DictionaryHandle, Index, StartItemHandle, ItemHandle) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl) \ + ->ItemFindByIndex(DictionaryHandle, Index, StartItemHandle, ItemHandle) #define IDictionary_ItemGetNext(DictionaryHandle, ItemHandle, NextItemHandle) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetNext(DictionaryHandle, ItemHandle, NextItemHandle) #define IDictionary_ItemGetPrev(DictionaryHandle, ItemHandle, PrevItemHandle) \ @@ -412,8 +395,8 @@ typedef struct IDictionaryVtbl { Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetFirst(DictionaryHandle, ItemHandle) #define IDictionary_ItemGetLast(DictionaryHandle, ItemHandle) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetLast(DictionaryHandle, ItemHandle) -#define IDictionary_ItemGetCount(DictionaryHandle, ItemCount) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetCount(DictionaryHandle, ItemCount) +#define IDictionary_ItemGetCount(DictionaryHandle) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->ItemGetCount(DictionaryHandle) #define IDictionary_Log(DictionaryHandle, Format, ...) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->Log(DictionaryHandle, Format, __VA_ARGS__) @@ -443,25 +426,25 @@ typedef struct IDictionaryVtbl { #define IDictionary_MergeItem(TargetDictionaryHandle, SourceDictionaryHandle, SourceItemHandle, Flags) \ Class_VtblCast(TargetDictionaryHandle, IDictionaryVtbl) \ ->MergeItem(TargetDictionaryHandle, SourceDictionaryHandle, SourceItemHandle, Flags) -#define IDictionary_SkipRoot(DictionaryHandle, DataDictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SkipRoot(DictionaryHandle, DataDictionaryHandle) -#define IDictionary_SkipRootContainer(DictionaryHandle, DataDictionaryHandle) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SkipRootContainer(DictionaryHandle, DataDictionaryHandle) +#define IDictionary_SkipRoot(DictionaryHandle) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SkipRoot(DictionaryHandle) +#define IDictionary_SkipRootContainer(DictionaryHandle) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SkipRootContainer(DictionaryHandle) #define IDictionary_Reset(DictionaryHandle) Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->Reset(DictionaryHandle) #define IDictionary_Dump(DictionaryHandle) Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->Dump(DictionaryHandle) #define IDictionary_SetCaseSensitive(DictionaryHandle, CaseSensitive) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetCaseSensitive(DictionaryHandle, CaseSensitive) -#define IDictionary_GetCaseSensitive(DictionaryHandle, CaseSensitive) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetCaseSensitive(DictionaryHandle, CaseSensitive) +#define IDictionary_GetCaseSensitive(DictionaryHandle) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetCaseSensitive(DictionaryHandle) #define IDictionary_SetPrivateKeys(DictionaryHandle, PrivateKeys) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetPrivateKeys(DictionaryHandle, PrivateKeys) -#define IDictionary_GetPrivateKeys(DictionaryHandle, PrivateKeys) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetPrivateKeys(DictionaryHandle, PrivateKeys) +#define IDictionary_GetPrivateKeys(DictionaryHandle) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetPrivateKeys(DictionaryHandle) #define IDictionary_SetAllowDuplicates(DictionaryHandle, AllowDuplicates) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetAllowDuplicates(DictionaryHandle, AllowDuplicates) -#define IDictionary_GetAllowDuplicates(DictionaryHandle, AllowDuplicates) \ - Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetAllowDuplicatese(DictionaryHandle, AllowDuplicates) +#define IDictionary_GetAllowDuplicates(DictionaryHandle) \ + Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetAllowDuplicates(DictionaryHandle) #define IDictionary_SetItemRemoveCallback(DictionaryHandle, UserPtr, Callback) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->SetItemRemoveCallback(DictionaryHandle, UserPtr, Callback) @@ -476,7 +459,7 @@ typedef struct IDictionaryVtbl { #define IDictionary_GetItemValueChangeCallback(DictionaryHandle, UserPtr, Callback) \ Class_VtblCast(DictionaryHandle, IDictionaryVtbl)->GetItemValueChangeCallback(DictionaryHandle, UserPtr, Callback) -#define IDictionary_Create(DictionaryHandle) Dictionary_Create(DictionaryHandle) +#define IDictionary_Create() Dictionary_Create() #define IDictionary_AddRef(DictionaryHandle) Dictionary_AddRef(DictionaryHandle) #define IDictionary_Release(DictionaryHandle) Dictionary_Release(DictionaryHandle) diff --git a/docs/dictionary.md b/docs/dictionary.md index e76c042..0a94db2 100644 --- a/docs/dictionary.md +++ b/docs/dictionary.md @@ -4,11 +4,9 @@ The Dictionary class and its interface are used to store structured data. * Dictionaries contains key/value pair items. * Dictionaries can contain items of the following types: null, boolean, int64, float64, string, list and dictionary. -* Dictionaries inherit the following settings from their parents: case-sensitivity, allowing duplicates, and string pooling. +* Dictionaries inherit the following settings from their parents: case-sensitivity and allowing duplicates. -**Important:** - -Use `Dictionary_Create` and `Dictionary_Release` to create and delete dictionaries. Then use the corresponding `IDictionary` interface function to call the `Dictionary` function referenced below. +**Interface** - [DICTIONARY\_TYPE](#dictionary_type) - [DICTIONARY\_MERGE](#dictionary_merge) @@ -16,13 +14,11 @@ Use `Dictionary_Create` and `Dictionary_Release` to create and delete dictionari - [Dictionary\_Add](#dictionary_add) - [Dictionary\_AddNull](#dictionary_addnull) - [Dictionary\_AddString](#dictionary_addstring) -- [Dictionary\_AddInt32](#dictionary_addint32) -- [Dictionary\_AddInt64](#dictionary_addint64) -- [Dictionary\_AddFloat64](#dictionary_addfloat64) +- [Dictionary\_AddInt](#dictionary_addint) +- [Dictionary\_AddFloat](#dictionary_addfloat) - [Dictionary\_AddBoolean](#dictionary_addboolean) - [Dictionary\_AddList](#dictionary_addlist) - [Dictionary\_AddDictionary](#dictionary_adddictionary) -- [Dictionary\_Append](#dictionary_append) - [Dictionary\_Insert](#dictionary_insert) - [Dictionary\_Remove](#dictionary_remove) - [Dictionary\_ConvertFromString](#dictionary_convertfromstring) @@ -45,18 +41,16 @@ Use `Dictionary_Create` and `Dictionary_Release` to create and delete dictionari - [Dictionary\_GetStringPtrByKey](#dictionary_getstringptrbykey) - [Dictionary\_GetBufferPtrByKey](#dictionary_getbufferptrbykey) - [Dictionary\_GetBufferPtrByPath](#dictionary_getbufferptrbypath) -- [Dictionary\_SetInt32ByKey](#dictionary_setint32bykey) -- [Dictionary\_SetInt32ByPath](#dictionary_setint32bypath) +- [Dictionary\_SetIntByKey](#dictionary_setintbykey) +- [Dictionary\_SetIntByPath](#dictionary_setintbypath) - [Dictionary\_GetInt32ByKey](#dictionary_getint32bykey) - [Dictionary\_GetInt32ByPath](#dictionary_getint32bypath) -- [Dictionary\_SetInt64ByKey](#dictionary_setint64bykey) -- [Dictionary\_SetInt64ByPath](#dictionary_setint64bypath) - [Dictionary\_GetInt64ByKey](#dictionary_getint64bykey) - [Dictionary\_GetInt64ByPath](#dictionary_getint64bypath) -- [Dictionary\_SetFloat64ByKey](#dictionary_setfloat64bykey) -- [Dictionary\_SetFloat64ByPath](#dictionary_setfloat64bypath) -- [Dictionary\_GetFloat64ByKey](#dictionary_getfloat64bykey) -- [Dictionary\_GetFloat64ByPath](#dictionary_getfloat64bypath) +- [Dictionary\_SetFloatByKey](#dictionary_setfloatbykey) +- [Dictionary\_SetFloatByPath](#dictionary_setfloatbypath) +- [Dictionary\_GetFloatByKey](#dictionary_getfloatbykey) +- [Dictionary\_GetFloatByPath](#dictionary_getfloatbypath) - [Dictionary\_SetBooleanByKey](#dictionary_setbooleanbykey) - [Dictionary\_SetBooleanByPath](#dictionary_setbooleanbypath) - [Dictionary\_GetBooleanByKey](#dictionary_getbooleanbykey) @@ -69,6 +63,7 @@ Use `Dictionary_Create` and `Dictionary_Release` to create and delete dictionari - [Dictionary\_ItemGetPath](#dictionary_itemgetpath) - [Dictionary\_ItemIsContainer](#dictionary_itemiscontainer) - [Dictionary\_ItemIsNull](#dictionary_itemisnull) +- [Dictionary\_ItemIsPrivate](#dictionary_itemisprivate) - [Dictionary\_ItemGetIndex](#dictionary_itemgetindex) - [Dictionary\_ItemSetType](#dictionary_itemsettype) - [Dictionary\_ItemGetType](#dictionary_itemgettype) @@ -84,11 +79,10 @@ Use `Dictionary_Create` and `Dictionary_Release` to create and delete dictionari - [Dictionary\_ItemGetStringPtr](#dictionary_itemgetstringptr) - [Dictionary\_ItemSetBuffer](#dictionary_itemsetbuffer) - [Dictionary\_ItemGetBufferPtr](#dictionary_itemgetbufferptr) -- [Dictionary\_ItemSetFloat64](#dictionary_itemsetfloat64) -- [Dictionary\_ItemGetFloat64](#dictionary_itemgetfloat64) -- [Dictionary\_ItemSetInt32](#dictionary_itemsetint32) +- [Dictionary\_ItemSetFloat](#dictionary_itemsetfloat) +- [Dictionary\_ItemGetFloat](#dictionary_itemgetfloat) +- [Dictionary\_ItemSetInt](#dictionary_itemsetint) - [Dictionary\_ItemGetInt32](#dictionary_itemgetint32) -- [Dictionary\_ItemSetInt64](#dictionary_itemsetint64) - [Dictionary\_ItemGetInt64](#dictionary_itemgetint64) - [Dictionary\_ItemSetBoolean](#dictionary_itemsetboolean) - [Dictionary\_ItemGetBoolean](#dictionary_itemgetboolean) @@ -118,6 +112,8 @@ Use `Dictionary_Create` and `Dictionary_Release` to create and delete dictionari - [Dictionary\_Dump](#dictionary_dump) - [Dictionary\_SetCaseSensitive](#dictionary_setcasesensitive) - [Dictionary\_GetCaseSensitive](#dictionary_getcasesensitive) +- [Dictionary\_SetPrivateKeys](#dictionary_setprivatekeys) +- [Dictionary\_GetPrivateKeys](#dictionary_getprivatekeys) - [Dictionary\_SetAllowDuplicates](#dictionary_setallowduplicates) - [Dictionary\_GetAllowDuplicates](#dictionary_getallowduplicates) - [Dictionary\_ItemRemoveCallback](#dictionary_itemremovecallback) @@ -143,15 +139,15 @@ Use `Dictionary_Create` and `Dictionary_Release` to create and delete dictionari These values indicate the type of an item. -|Name|Value|Description| -|-|-|-| -|UNKNOWN|0|Not specified| -|BOOLEAN|1|Boolean value, true = 1, false = 0| -|INT64|2|64-bit integer| -|FLOAT64|3|64-bit floating point integer| -|STRING|4|UTF8 character buffer| -|LIST|5|Items containing no key| -|DICTIONARY|6|Key/value pairs| +| Name | Value | Description | +|------------|-------|------------------------------------| +| UNKNOWN | 0 | Not specified | +| BOOLEAN | 1 | Boolean value, true = 1, false = 0 | +| INT64 | 2 | 64-bit integer | +| FLOAT64 | 3 | 64-bit floating point integer | +| STRING | 4 | UTF8 character buffer | +| LIST | 5 | Items containing no key | +| DICTIONARY | 6 | Key/value pairs | **Notes:** @@ -161,21 +157,21 @@ These values indicate the type of an item. These values indicate how items will be merged when copying from one dictionary into another. -|Name|Value|Description| -|-|-|-| -|OVERWRITE|0x01|Existing items will be overwritten| -|INSERT|0x02|New items will be inserted at the beginning| -|APPEND|0x04|New items will be appended to the end| +| Name | Value | Description | +|-----------|-------|---------------------------------------------| +| OVERWRITE | 0x01 | Existing items will be overwritten | +| INSERT | 0x02 | New items will be inserted at the beginning | +| APPEND | 0x04 | New items will be appended to the end | ### Dictionary_GetParent Gets a child dictionary's parent instance along with the associated item in the parent where the child dictionary can be found. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Child dictionary handle| -|ParentDictionaryHandle|echandle*|Parent dictionary handle| -|ParentItemHandle|echandle*|Item handle in parent dictionary where child dictionary can be found.| +| Name | Type | Description | +|------------------------|-----------|-----------------------------------------------------------------------| +| DictionaryHandle | echandle | Child dictionary handle | +| ParentDictionaryHandle | echandle* | Parent dictionary handle | +| ParentItemHandle | echandle* | Item handle in parent dictionary where child dictionary can be found. | Returns true if child dictionary has a parent, false otherwise. @@ -183,122 +179,106 @@ Returns true if child dictionary has a parent, false otherwise. Adds an item to the dictionary with a key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Key string| -|ItemHandle|echandle*|Item handle that is created| +| Name | Type | Description | +|------------------|-------------|-----------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Key string | +| ItemHandle | echandle* | Item handle that is created | **Notes:** * The item added to the dictionary is not assigned a type unless Dictionary_ItemSetType is called. -* New items added using this function are appended on to the backend of the list of items in the dictionary (also see Dictionary_Append). +* New items added using this function are appended on to the backend of the list of items in the dictionary. Returns true if added successfully, false otherwise. ### Dictionary_AddNull Adds a null typed item to the dictionary with a key. -```json +``` { "myKey": null } ``` -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Key string| -|ItemHandle|echandle*|Item handle that is created| +| Name | Type | Description | +|------------------|-------------|-----------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Key string | +| ItemHandle | echandle* | Item handle that is created | Returns true if added successfully, false otherwise. ### Dictionary_AddString Adds a string typed item to the dictionary with a key and value. -```json -{ "myKey": "myValue" } ``` -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Key string| -|Value|const char*|Value string| -|ItemHandle|echandle*|Item handle that is created| - -Returns true if added successfully, false otherwise. - -### Dictionary_AddInt32 - -Adds a 32-bit integer typed item to the dictionary with a key and value. -```json -{ "myTraySize": 1020 } +{ "myKey": "myValue" } ``` - -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Key string| -|Value|int32_t|32-bit integer value| -|ItemHandle|echandle*|Item handle that is created| +| Name | Type | Description | +|------------------|-------------|-----------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Key string | +| Value | const char* | Value string | +| ItemHandle | echandle* | Item handle that is created | Returns true if added successfully, false otherwise. -### Dictionary_AddInt64 +### Dictionary_AddInt Adds a 64-bit integer typed item to the dictionary with a key and value. -```json +``` { "myTraySize": 1061208000 } ``` -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Key string| -|Value|int64|64-bit integer value| -|ItemHandle|echandle*|Item handle that is created| +| Name | Type | Description | +|------------------|-------------|-----------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Key string | +| Value | int64 | 64-bit integer value | +| ItemHandle | echandle* | Item handle that is created | Returns true if added successfully, false otherwise. -### Dictionary_AddFloat64 +### Dictionary_AddFloat Adds a 64-bit floating integer typed item to the dictionary with a key and value. -```json +``` { "myTraySize": 1020.0 } ``` -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Key string| -|Value|float64|64-bit floating integer value| -|ItemHandle|echandle*|Item handle that is created| +| Name | Type | Description | +|------------------|-------------|-------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Key string | +| Value | float64 | 64-bit floating integer value | +| ItemHandle | echandle* | Item handle that is created | Returns true if added successfully, false otherwise. ### Dictionary_AddBoolean Adds a boolean typed item to the dictionary with a key and value. -```json +``` { "isEnabled": false } ``` -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Key string| -|Value|int32_t|Boolean value (0 or 1)| -|ItemHandle|echandle*|Item handle that is created| +| Name | Type | Description | +|------------------|-------------|-----------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Key string | +| Value | int32_t | Boolean value (0 or 1) | +| ItemHandle | echandle* | Item handle that is created | Returns true if added successfully, false otherwise. ### Dictionary_AddList Adds a list typed item to the dictionary with a key. -```json +``` { "myList": [ ] } ``` -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Key string| -|ListHandle|echandle*|Handle for created list Dictionary| -|ItemHandle|echandle*|Item handle that is created in dictionary| +| Name | Type | Description | +|------------------|-------------|-------------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Key string | +| ListHandle | echandle* | Handle for created list Dictionary | +| ItemHandle | echandle* | Item handle that is created in dictionary | **Notes:** @@ -309,32 +289,28 @@ Returns true if added successfully, false otherwise. ### Dictionary_AddDictionary Adds a dictionary typed item to the dictionary with a key. -```json +``` { "myObject": { } } ``` -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Key string| -|DictHandle|echandle*|Handle for created dictionary| -|ItemHandle|echandle*|Item handle that is created in dictionary| +| Name | Type | Description | +|------------------|-------------|-------------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Key string | +| DictHandle | echandle* | Handle for created dictionary | +| ItemHandle | echandle* | Item handle that is created in dictionary | Returns true if added successfully, false otherwise. -### Dictionary_Append - -Appends a new item to the dictionary. The function operates the same as Dictionary_Add. - ### Dictionary_Insert Inserts a new item in the dictionary. The item will be inserted after the item indicated by PrevItemHandle. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|PrevItemHandle|echandle|Previous item handle| -|Key|const char*|Key string| -|ItemHandle|echandle*|Item handle that is created in dictionary| +| Name | Type | Description | +|------------------|-------------|-------------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| PrevItemHandle | echandle | Previous item handle | +| Key | const char* | Key string | +| ItemHandle | echandle* | Item handle that is created in dictionary | Returns true if successful, false otherwise. @@ -342,10 +318,10 @@ Returns true if successful, false otherwise. Removes an item from the dictionary given it's handle. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Handle of item to remove| +| Name | Type | Description | +|------------------|----------|--------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Handle of item to remove | Returns true if removed successfully, false otherwise. @@ -353,22 +329,17 @@ Returns true if removed successfully, false otherwise. Loads a key/value pair string into the dictionary. -_Input String_ ``` -key1=value1;key2=value2 -``` -_Output Structure_ -```json -{ "key1": "value1", "key2": "value2" } +key1=value1;key2=value2; => { "key1": "value1", "key2": "value2" } ``` -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Value|char*|String to convert| -|MaxValue|int32_t|Maximum length of string to convert| -|KeyValueSeparator|char|Character that separators keys from values (ie: =)| -|ItemSeparator|char|Character that separators items from each other (ie: ;)| +| Name | Type | Description | +|-------------------|----------|---------------------------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Value | char* | String to convert | +| MaxValue | int32_t | Maximum length of string to convert | +| KeyValueSeparator | char | Character that separators keys from values (ie: =) | +| ItemSeparator | char | Character that separators items from each other (ie: ;) | Returns true if successful, false otherwise. @@ -376,22 +347,17 @@ Returns true if successful, false otherwise. Converts a dictionary into a key/value pair string. -_Input Structure_ -```json -{ "key1": "value1", "key2": "value2" } -``` -_Output String_ ``` -key1=value1;key2=value2; +{ "key1": "value1", "key2": "value2" } => key1=value1;key2=value2; ``` -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Value|char*|Conversion string buffer| -|MaxValue|int32_t|Maximum length of conversion string buffer| -|KeyValueSeparator|char|Character that separators keys from values (ie: =)| -|ItemSeparator|char|Character that separators items from each other (ie: ;)| +| Name | Type | Description | +|-------------------|----------|---------------------------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Value | char* | Conversion string buffer | +| MaxValue | int32_t | Maximum length of conversion string buffer | +| KeyValueSeparator | char | Character that separators keys from values (ie: =) | +| ItemSeparator | char | Character that separators items from each other (ie: ;) | Returns true if successful, false otherwise. @@ -399,10 +365,10 @@ Returns true if successful, false otherwise. Gets whether or not the dictionary contains an item with the specified key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Key to search for| +| Name | Type | Description | +|------------------|-------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Key to search for | Returns true if dictionary contains key, false otherwise. @@ -410,11 +376,11 @@ Returns true if dictionary contains key, false otherwise. Ensures that the specified item by index exists in the dictionary. If the item at the specified does not exist, it will be created. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Index|int32_t|Index of item to retrieve| -|ItemHandle|echandle*|Item handle at the specified index| +| Name | Type | Description | +|------------------|-----------|------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Index | int32_t | Index of item to retrieve | +| ItemHandle | echandle* | Item handle at the specified index | Returns true if successful, false otherwise. @@ -426,11 +392,11 @@ Returns true if successful, false otherwise. Ensures that an item exists for the key. If the item does not exist, it an empty non-typed item be created with the specified key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Key of item to ensure exists| -|ItemHandle|echandle*|Item handle at the specified index| +| Name | Type | Description | +|------------------|-------------|------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Key of item to ensure exists | +| ItemHandle | echandle* | Item handle at the specified index | Returns true if successful, false otherwise. @@ -438,12 +404,12 @@ Returns true if successful, false otherwise. Ensures that a list typed item exists for the key. If the item does not exist, it will be created. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item to ensure exists| -|ItemHandle|echandle*|Item handle that was created| -|ItemDictionaryHandle|echandle*|Handle to the list dictionary for the key| +| Name | Type | Description | +|----------------------|-------------|-------------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item to ensure exists | +| ItemHandle | echandle* | Item handle that was created | +| ItemDictionaryHandle | echandle* | Handle to the list dictionary for the key | Returns true if successful, false otherwise. @@ -451,12 +417,12 @@ Returns true if successful, false otherwise. Ensures that the specified item by index exists in the dictionary and ensures that it is a list typed item. If the item at the specified does not exist, it will be created. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Index|int32_t|Index of item to retrieve| -|ItemHandle|echandle*|Item handle at the specified index| -|ItemDictionaryHandle|echandle*|Handle to the list dictionary| +| Name | Type | Description | +|----------------------|-----------|------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Index | int32_t | Index of item to retrieve | +| ItemHandle | echandle* | Item handle at the specified index | +| ItemDictionaryHandle | echandle* | Handle to the list dictionary | Returns true if successful, false otherwise. @@ -468,12 +434,12 @@ Returns true if successful, false otherwise. Ensures that a dictionary typed item exists for the key. If the item does not exist, it will be created. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item to ensure exists| -|ItemHandle|echandle*|Item handle that was created| -|ItemDictionaryHandle|echandle*|Handle to the dictionary for the key| +| Name | Type | Description | +|----------------------|-------------|--------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item to ensure exists | +| ItemHandle | echandle* | Item handle that was created | +| ItemDictionaryHandle | echandle* | Handle to the dictionary for the key | Returns true if successful, false otherwise. @@ -481,20 +447,15 @@ Returns true if successful, false otherwise. Ensures that the path specified exists in the dictionary. If the path does not exist, it will be created. -_Input Path_ ``` -myKey.mySubKey -``` -_Search Structure_ -```json -{ "myKey": { "mySubKey": { "hello": "world" } } } +myKey.mySubKey >> { "myKey": { "mySubKey": { "hello": "world" } } } ``` -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Path|const char*|Path to ensure it exists (ie: myKey.mySubKey)| -|ItemDictionaryHandle|echandle*|Handle to the list dictionary| +| Name | Type | Description | +|----------------------|-------------|-----------------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Path | const char* | Path to ensure it exists (ie: myKey.mySubKey) | +| ItemDictionaryHandle | echandle* | Handle to the list dictionary | Returns true if successful, false otherwise. @@ -506,12 +467,12 @@ Returns true if successful, false otherwise. Ensures that the specified item by index exists in the dictionary and ensures that it is a dictionary typed item. If the item at the specified index does not exist, it will be created. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Index|int32_t|Index of item to retrieve| -|ItemHandle|echandle*|Item handle at the specified index| -|ItemDictionaryHandle|echandle*|Handle to the dictionary at the index| +| Name | Type | Description | +|----------------------|-----------|---------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Index | int32_t | Index of item to retrieve | +| ItemHandle | echandle* | Item handle at the specified index | +| ItemDictionaryHandle | echandle* | Handle to the dictionary at the index | Returns true if successful, false otherwise. @@ -523,11 +484,11 @@ Returns true if successful, false otherwise. Gets the type of the item specified by the key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|Type|int32_t*|Type of the item (see DICTIONARY_TYPE)| +| Name | Type | Description | +|------------------|-------------|----------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| Type | int32_t* | Type of the item (see DICTIONARY_TYPE) | Returns true if item exists, false otherwise. @@ -535,11 +496,11 @@ Returns true if item exists, false otherwise. Sets the string for an item specified by key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|String|const char*|Value string| +| Name | Type | Description | +|------------------|-------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| String | const char* | Value string | Returns true if successful, false otherwise. @@ -547,12 +508,12 @@ Returns true if successful, false otherwise. Sets the string using a formatted specifier and variable argument list for an item specified by key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|String|const char*|Value string with sprintf format specifiers| -|ArgumentList|va_list|Variable argument list for sprintf| +| Name | Type | Description | +|------------------|-------------|---------------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| String | const char* | Value string with sprintf format specifiers | +| ArgumentList | va_list | Variable argument list for sprintf | Returns true if successful, false otherwise. @@ -560,12 +521,12 @@ Returns true if successful, false otherwise. Sets the string using a formatted specifier for an item specified by key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|String|const char*|Value string with sprintf format specifiers| -|...||Variable arguments for sprintf| +| Name | Type | Description | +|------------------|-------------|---------------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| String | const char* | Value string with sprintf format specifiers | +| ... | | Variable arguments for sprintf | Returns true if successful, false otherwise. @@ -573,12 +534,12 @@ Returns true if successful, false otherwise. Gets the string for an item specified by key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|String|char*|Value string buffer| -|MaxString|int32_t|Maximum length of value string buffer| +| Name | Type | Description | +|------------------|-------------|---------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| String | char* | Value string buffer | +| MaxString | int32_t | Maximum length of value string buffer | Returns true if item exists, false otherwise. @@ -586,20 +547,15 @@ Returns true if item exists, false otherwise. Sets the string for an item specified by path. -_Input Path and Value_ -``` -f1.f2.key1=val1 ``` -_Output Structure_ -```json -{ "f1": { "f2": { "key1": "val1" } } } +f1.f2.key1=val1 >> { "f1": { "f2": { "key1": "val1" } } } ``` -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Path|const char*|Location of item (ie: f1.f2.key1)| -|String|const char*|Value string (ie: val1)| +| Name | Type | Description | +|------------------|-------------|-----------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Path | const char* | Location of item (ie: f1.f2.key1) | +| String | const char* | Value string (ie: val1) | Returns true if successful, false otherwise. @@ -607,25 +563,16 @@ Returns true if successful, false otherwise. Gets the string for an item specified by path. -_Input Path_ -``` -f1.f2.key1 -``` -_Input Structure_ -```json -{ "f1": { "f2": { "key1": "val1" } } } -``` -_Expected Value_ ``` -val1 +f1.f2.key1 >> { "f1": { "f2": { "key1": "val1" } } } = val1 ``` -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Path|const char*|Location of item (ie: f1.f2.string)| -|String|char*|Value string| -|MaxString|int32_t|Maximum length of value string buffer| +| Name | Type | Description | +|------------------|-------------|---------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Path | const char* | Location of item (ie: f1.f2.string) | +| String | char* | Value string | +| MaxString | int32_t | Maximum length of value string buffer | Returns true if item exists, false otherwise. @@ -633,11 +580,11 @@ Returns true if item exists, false otherwise. Gets the pointer to the string for an item specified by key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|StringPtr|const char**|Value string pointer| +| Name | Type | Description | +|------------------|--------------|----------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| StringPtr | const char** | Value string pointer | Returns true if item exists, false otherwise. @@ -645,12 +592,12 @@ Returns true if item exists, false otherwise. Gets the raw memory buffer pointer for an item specified by key. The memory buffer is null-terminated. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|BufferPtr|const char**|Buffer pointer| -|BufferLength|int32_t*|Buffer pointer length| +| Name | Type | Description | +|------------------|--------------|-----------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| BufferPtr | const char** | Buffer pointer | +| BufferLength | int32_t* | Buffer pointer length | Returns true if item exists, false otherwise. @@ -658,36 +605,36 @@ Returns true if item exists, false otherwise. Gets the raw memory buffer pointer for an item specified by path. The memory buffer is null-terminated. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Path|const char*|Location of item| -|BufferPtr|const char**|Buffer pointer| -|BufferLength|int32_t*|Buffer pointer length| +| Name | Type | Description | +|------------------|--------------|-----------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Path | const char* | Location of item | +| BufferPtr | const char** | Buffer pointer | +| BufferLength | int32_t* | Buffer pointer length | Returns true if item exists, false otherwise. -### Dictionary_SetInt32ByKey +### Dictionary_SetIntByKey -Sets the 32-bit integer value for an item specified by key. +Sets the 64-bit integer value for an item specified by key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|Value|int32_t|32-bit integer value| +| Name | Type | Description | +|------------------|-------------|----------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| Value | int64 | 64-bit integer value | Returns true if successful, false otherwise. -### Dictionary_SetInt32ByPath +### Dictionary_SetIntByPath -Sets the 32-bit integer value for an item specified by path. +Sets the 64-bit integer value for an item specified by path. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Path|const char*|Location of item| -|Value|int32_t|32-bit integer value| +| Name | Type | Description | +|------------------|-------------|----------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Path | const char* | Location of item | +| Value | int64 | 64-bit integer value | Returns true if successful, false otherwise. @@ -695,11 +642,11 @@ Returns true if successful, false otherwise. Gets the 32-bit integer value for an item specified by key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|Value|int32_t*|32-bit integer value| +| Name | Type | Description | +|------------------|-------------|----------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| Value | int32_t* | 32-bit integer value | Returns true if successful, false otherwise. @@ -707,35 +654,11 @@ Returns true if successful, false otherwise. Gets the 32-bit integer value for an item specified by path. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Path|const char*|Location of item| -|Value|int32_t*|32-bit integer value| - -Returns true if successful, false otherwise. - -### Dictionary_SetInt64ByKey - -Sets the 64-bit integer value for an item specified by key. - -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|Value|int64|64-bit integer value| - -Returns true if successful, false otherwise. - -### Dictionary_SetInt64ByPath - -Sets the 64-bit integer value for an item specified by path. - -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Path|const char*|Location of item| -|Value|int64|64-bit integer value| +| Name | Type | Description | +|------------------|-------------|----------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Path | const char* | Location of item | +| Value | int32_t* | 32-bit integer value | Returns true if successful, false otherwise. @@ -743,11 +666,11 @@ Returns true if successful, false otherwise. Gets the 64-bit integer value for an item specified by key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|Value|int64*|64-bit integer value| +| Name | Type | Description | +|------------------|-------------|----------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| Value | int64* | 64-bit integer value | Returns true if successful, false otherwise. @@ -755,59 +678,59 @@ Returns true if successful, false otherwise. Gets the 64-bit integer value for an item specified by path. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Path|const char*|Location of item| -|Value|int64*|64-bit integer value| +| Name | Type | Description | +|------------------|-------------|----------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Path | const char* | Location of item | +| Value | int64* | 64-bit integer value | Returns true if successful, false otherwise. -### Dictionary_SetFloat64ByKey +### Dictionary_SetFloatByKey Sets the 64-bit floating point integer value for an item specified by key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|Value|float64|64-bit floating point integer value| +| Name | Type | Description | +|------------------|-------------|-------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| Value | float64 | 64-bit floating point integer value | Returns true if successful, false otherwise. -### Dictionary_SetFloat64ByPath +### Dictionary_SetFloatByPath Sets the 64-bit floating point integer value for an item specified by path. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Path|const char*|Location of item| -|Value|float64|64-bit floating point integer value| +| Name | Type | Description | +|------------------|-------------|-------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Path | const char* | Location of item | +| Value | float64 | 64-bit floating point integer value | Returns true if successful, false otherwise. -### Dictionary_GetFloat64ByKey +### Dictionary_GetFloatByKey Gets the 64-bit floating point integer value for an item specified by key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|Value|float64*|64-bit floating point integer value| +| Name | Type | Description | +|------------------|-------------|-------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| Value | float64* | 64-bit floating point integer value | Returns true if successful, false otherwise. -### Dictionary_GetFloat64ByPath +### Dictionary_GetFloatByPath Gets the 64-bit floating point integer value for an item specified by path. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Path|const char*|Location of item| -|Value|float64*|64-bit floating point integer value| +| Name | Type | Description | +|------------------|-------------|-------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Path | const char* | Location of item | +| Value | float64* | 64-bit floating point integer value | Returns true if successful, false otherwise. @@ -815,11 +738,11 @@ Returns true if successful, false otherwise. Sets the boolean value for an item specified by key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|Value|int32_t|Boolean value| +| Name | Type | Description | +|------------------|-------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| Value | int32_t | Boolean value | Returns true if successful, false otherwise. @@ -827,11 +750,11 @@ Returns true if successful, false otherwise. Sets the boolean value for an item specified by path. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Path|const char*|Location of item| -|Value|int32_t|Boolean value| +| Name | Type | Description | +|------------------|-------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Path | const char* | Location of item | +| Value | int32_t | Boolean value | Returns true if successful, false otherwise. @@ -839,11 +762,11 @@ Returns true if successful, false otherwise. Gets the boolean value for an item specified by key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|Value|int32_t*|Boolean value| +| Name | Type | Description | +|------------------|-------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| Value | int32_t* | Boolean value | Returns true if successful, false otherwise. @@ -851,11 +774,11 @@ Returns true if successful, false otherwise. Gets the boolean value for an item specified by path. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Path|const char*|Location of item| -|Value|int32_t*|Boolean value| +| Name | Type | Description | +|------------------|-------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Path | const char* | Location of item | +| Value | int32_t* | Boolean value | Returns true if successful, false otherwise. @@ -863,11 +786,11 @@ Returns true if successful, false otherwise. Gets the list at the specified index. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Index|int32_t|Index of item| -|ItemDictionaryHandle|echandle*|List dictionary handle| +| Name | Type | Description | +|----------------------|-----------|------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Index | int32_t | Index of item | +| ItemDictionaryHandle | echandle* | List dictionary handle | Returns true if item exists at index and is a list, false otherwise. @@ -875,11 +798,11 @@ Returns true if item exists at index and is a list, false otherwise. Gets the dictionary at the specified index. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Index|int32_t|Index of item| -|ItemDictionaryHandle|echandle*|Dictionary handle for item| +| Name | Type | Description | +|----------------------|-----------|----------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Index | int32_t | Index of item | +| ItemDictionaryHandle | echandle* | Dictionary handle for item | Returns true if item exists at index and is a dictionary, false otherwise. @@ -887,11 +810,11 @@ Returns true if item exists at index and is a dictionary, false otherwise. Gets the list at the specified key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|ItemDictionaryHandle|echandle*|List dictionary handle| +| Name | Type | Description | +|----------------------|-------------|------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| ItemDictionaryHandle | echandle* | List dictionary handle | Returns true if item exists with key and is a list, false otherwise. @@ -899,11 +822,11 @@ Returns true if item exists with key and is a list, false otherwise. Gets the dictionary at the specified key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|ItemDictionaryHandle|echandle*|Dictionary handle for item| +| Name | Type | Description | +|----------------------|-------------|----------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| ItemDictionaryHandle | echandle* | Dictionary handle for item | Returns true if item exists with key and is a dictionary, false otherwise. @@ -911,10 +834,10 @@ Returns true if item exists with key and is a dictionary, false otherwise. Remove an item specified by key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| +| Name | Type | Description | +|------------------|-------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | Returns true if removed successfully, false otherwise. @@ -922,13 +845,13 @@ Returns true if removed successfully, false otherwise. Gets a path for a dictionary item. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|TopDictionaryHandle|echandle|Dictionary handle to stop at| -|Path|char*|Path buffer| -|MaxPath|int32_t|Maximum length of path buffer| +| Name | Type | Description | +|---------------------|----------|-------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| TopDictionaryHandle | echandle | Dictionary handle to stop at | +| Path | char* | Path buffer | +| MaxPath | int32_t | Maximum length of path buffer | Returns true if successfully, false otherwise. @@ -936,10 +859,10 @@ Returns true if successfully, false otherwise. Gets whether or not the item is a list or dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | Returns true if the item is a list or dictionary, false otherwise. @@ -947,22 +870,33 @@ Returns true if the item is a list or dictionary, false otherwise. Gets whether or not the item is null typed. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | Returns true if the item is null typed, false otherwise. +### Dictionary_ItemIsPrivate + +Gets whether or not the item is marked private. Private key/value pairs are not sent to any analytics endpoint. + +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | + +Returns true if the item is private, false otherwise. + ### Dictionary_ItemGetIndex Gets the index of the item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|Index|int32_t*|Index of item| +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| Index | int32_t* | Index of item | Returns true if successful, false otherwise. @@ -970,11 +904,11 @@ Returns true if successful, false otherwise. Sets the type of an item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|Type|int32_t|Type of the item (See DICTIONARY_TYPE)| +| Name | Type | Description | +|------------------|----------|----------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| Type | int32_t | Type of the item (See DICTIONARY_TYPE) | Returns true if successful, false otherwise. @@ -986,23 +920,22 @@ Returns true if successful, false otherwise. Gets the type of an item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|Type|int32_t*|Type of the item (See DICTIONARY_TYPE)| +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | -Returns true if successful, false otherwise. +Returns `DICTIONARY_TYPE`. ### Dictionary_ItemCompareType Determine if an item in the dictionary is of a particular type. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|Type|int32_t|Type to check (See DICTIONARY_TYPE)| +| Name | Type | Description | +|------------------|----------|-------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| Type | int32_t | Type to check (See DICTIONARY_TYPE) | Returns true if the item's type matches the Type specified, false otherwise. @@ -1010,11 +943,11 @@ Returns true if the item's type matches the Type specified, false otherwise. Sets the key of the item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|Key|const char*|Name of item| +| Name | Type | Description | +|------------------|-------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| Key | const char* | Name of item | Returns true if successful, false otherwise. @@ -1022,12 +955,12 @@ Returns true if successful, false otherwise. Sets the key of the item in the dictionary. Copies the key name up to the length specified. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|Key|const char*|Name of item| -|KeyLength|int32_t|Number of bytes in the name to copy| +| Name | Type | Description | +|------------------|-------------|-------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| Key | const char* | Name of item | +| KeyLength | int32_t | Number of bytes in the name to copy | Returns true if successful, false otherwise. @@ -1035,12 +968,12 @@ Returns true if successful, false otherwise. Gets the key of the item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|Key|char*|Key buffer| -|MaxKey|int32_t|Maximum length of key buffer| +| Name | Type | Description | +|------------------|----------|------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| Key | char* | Key buffer | +| MaxKey | int32_t | Maximum length of key buffer | Returns true if successful, false otherwise. @@ -1048,11 +981,11 @@ Returns true if successful, false otherwise. Gets a pointer to the key of the item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|KeyPtr|const char**|Pointer to key string| +| Name | Type | Description | +|------------------|--------------|-----------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| KeyPtr | const char** | Pointer to key string | Returns true if successful, false otherwise. @@ -1060,11 +993,11 @@ Returns true if successful, false otherwise. Sets the string of the item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|String|const char*|Value string| +| Name | Type | Description | +|------------------|-------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| String | const char* | Value string | Returns true if successful, false otherwise. @@ -1072,12 +1005,12 @@ Returns true if successful, false otherwise. Sets the string of the item in the dictionary using a print format specifier. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|String|const char*|Value string with print format specifiers| -|...||Arguments for print format specifier| +| Name | Type | Description | +|------------------|-------------|-------------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| String | const char* | Value string with print format specifiers | +| ... | | Arguments for print format specifier | Returns true if successful, false otherwise. @@ -1085,12 +1018,12 @@ Returns true if successful, false otherwise. Sets the string of the item in the dictionary using a print format specifier and variable argument list. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|String|const char*|Value string with print format specifiers| -|ArgumentList|va_list|Variable argument list for print format specifier| +| Name | Type | Description | +|------------------|-------------|---------------------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| String | const char* | Value string with print format specifiers | +| ArgumentList | va_list | Variable argument list for print format specifier | Returns true if successful, false otherwise. @@ -1098,12 +1031,12 @@ Returns true if successful, false otherwise. Gets the string of the item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|String|char*|Value string buffer| -|MaxString|int32_t|Maximum length of value string buffer| +| Name | Type | Description | +|------------------|----------|---------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| String | char* | Value string buffer | +| MaxString | int32_t | Maximum length of value string buffer | Returns true if successful, false otherwise. @@ -1111,11 +1044,11 @@ Returns true if successful, false otherwise. Gets a pointer to the string of the item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|StringPtr|const char**|Value string pointer| +| Name | Type | Description | +|------------------|--------------|----------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| StringPtr | const char** | Value string pointer | Returns true if successful, false otherwise. @@ -1123,12 +1056,12 @@ Returns true if successful, false otherwise. Copies the raw memory buffer for the item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|Buffer|const char*|Buffer to copy| -|BufferLength|int32_t|Bytes to copy| +| Name | Type | Description | +|------------------|-------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| Buffer | const char* | Buffer to copy | +| BufferLength | int32_t | Bytes to copy | Returns true if successful, false otherwise. @@ -1142,12 +1075,12 @@ Returns true if successful, false otherwise. Gets a pointer to the raw memory buffer for the item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|BufferPtr|const char**|Buffer pointer| -|BufferLength|int32_t*|Buffer length| +| Name | Type | Description | +|------------------|--------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| BufferPtr | const char** | Buffer pointer | +| BufferLength | int32_t* | Buffer length | Returns true if successful, false otherwise. @@ -1156,27 +1089,27 @@ Returns true if successful, false otherwise. * The buffer pointer always points to a memory allocation that is null-terminated. * BufferLength argument can be NULL if the length of the buffer is not needed. -### Dictionary_ItemSetFloat64 +### Dictionary_ItemSetFloat Sets the 64-bit floating point integer value for the item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|Value|float64|64-bit floating point integer value| +| Name | Type | Description | +|------------------|----------|-------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| Value | float64 | 64-bit floating point integer value | Returns true. -### Dictionary_ItemGetFloat64 +### Dictionary_ItemGetFloat Gets the 64-bit floating point integer value for the item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|Value|float64*|64-bit floating point integer value| +| Name | Type | Description | +|------------------|----------|-------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| Value | float64* | 64-bit floating point integer value | Returns true if item is typed a 64-bit floating point integer or 64-bit integer, false otherwise. @@ -1184,15 +1117,15 @@ Returns true if item is typed a 64-bit floating point integer or 64-bit integer, * If the item is 64-bit integer typed, the returned value will be a casted 64-bit floating point integer. -### Dictionary_ItemSetInt32 +### Dictionary_ItemSetInt -Sets the 32-bit integer value for the item in the dictionary. +Sets the 64-bit integer value for the item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|Value|int32_t|32-bit integer value| +| Name | Type | Description | +|------------------|----------|----------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| Value | int64 | 64-bit integer value | Returns true. @@ -1200,11 +1133,11 @@ Returns true. Gets the 32-bit integer value for the item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|Value|int32_t*|32-bit integer value| +| Name | Type | Description | +|------------------|----------|----------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| Value | int32_t* | 32-bit integer value | Returns true if item is a typed 64-bit integer or 64-bit floating point integer, false otherwise. @@ -1212,27 +1145,15 @@ Returns true if item is a typed 64-bit integer or 64-bit floating point integer, * If the item is 64-bit integer typed or 64-bit floating point integer typed, the returned value will be a casted 32-bit integer. -### Dictionary_ItemSetInt64 - -Sets the 64-bit integer value for the item in the dictionary. - -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|Value|int64|64-bit integer value| - -Returns true. - ### Dictionary_ItemGetInt64 Gets the 64-bit integer value for the item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|Value|int64*|64-bit integer value| +| Name | Type | Description | +|------------------|----------|----------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| Value | int64* | 64-bit integer value | Returns true if item is a typed 64-bit integer or 64-bit floating point integer, false otherwise. @@ -1244,11 +1165,11 @@ Returns true if item is a typed 64-bit integer or 64-bit floating point integer, Sets the boolean value for the item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|Value|int32_t|Boolean value| +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| Value | int32_t | Boolean value | Returns true. @@ -1256,11 +1177,11 @@ Returns true. Gets the boolean value for the item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|Value|int32_t*|Boolean value| +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| Value | int32_t* | Boolean value | Returns true if item is boolean typed, false otherwise. @@ -1272,11 +1193,11 @@ Returns true. Gets the item's dictionary handle if the item is dictionary typed. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Item handle| -|DictHandle|echandle*|Item dictionary handle| +| Name | Type | Description | +|------------------|-----------|------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Item handle | +| DictHandle | echandle* | Item dictionary handle | Returns true if the item is dictionary typed, false otherwise. @@ -1284,12 +1205,12 @@ Returns true if the item is dictionary typed, false otherwise. Finds an item in the dictionary by path. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Path|const char*|Location of item| -|ItemDictionaryHandle|echandle*|Handle to immediately dictionary where item is found| -|ItemHandle|echandle*|Handle to item that was found| +| Name | Type | Description | +|----------------------|-------------|------------------------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Path | const char* | Location of item | +| ItemDictionaryHandle | echandle* | Handle to immediately dictionary where item is found | +| ItemHandle | echandle* | Handle to item that was found | Returns true if the item was found, false otherwise. @@ -1297,12 +1218,12 @@ Returns true if the item was found, false otherwise. Finds an item in the dictionary by key. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Key|const char*|Name of item| -|StartItemHandle|echandle|Handle to item to start search at or NULL| -|ItemHandle|echandle*|Handle to item if found| +| Name | Type | Description | +|------------------|-------------|-------------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Key | const char* | Name of item | +| StartItemHandle | echandle | Handle to item to start search at or NULL | +| ItemHandle | echandle* | Handle to item if found | Returns true if the item was found, false otherwise. @@ -1310,13 +1231,13 @@ Returns true if the item was found, false otherwise. Finds an item in the dictionary by value buffer. Searches every item's value buffer to find a match. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Buffer|const char*|Value buffer| -|BufferLength|int32_t|Value buffer length| -|StartItemHandle|echandle|Handle to item to start search at or NULL| -|ItemHandle|echandle*|Handle to item if found| +| Name | Type | Description | +|------------------|-------------|-------------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Buffer | const char* | Value buffer | +| BufferLength | int32_t | Value buffer length | +| StartItemHandle | echandle | Handle to item to start search at or NULL | +| ItemHandle | echandle* | Handle to item if found | Returns true if the item was found, false otherwise. @@ -1324,12 +1245,12 @@ Returns true if the item was found, false otherwise. Finds an item in the dictionary by index. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Index|int32_t|Index of item| -|StartItemHandle|echandle|Handle to item to start search at or NULL| -|ItemHandle|echandle*|Handle to item if found| +| Name | Type | Description | +|------------------|-----------|-------------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Index | int32_t | Index of item | +| StartItemHandle | echandle | Handle to item to start search at or NULL | +| ItemHandle | echandle* | Handle to item if found | Returns true if the item was found, false otherwise. @@ -1337,11 +1258,11 @@ Returns true if the item was found, false otherwise. Gets the next item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Current item handle| -|NextItemHandle|echandle*|Next item handle| +| Name | Type | Description | +|------------------|-----------|---------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Current item handle | +| NextItemHandle | echandle* | Next item handle | Returns true if successful, false otherwise. @@ -1349,11 +1270,11 @@ Returns true if successful, false otherwise. Gets the previous item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Current item handle| -|PrevItemHandle|echandle*|Previous item handle| +| Name | Type | Description | +|------------------|-----------|----------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Current item handle | +| PrevItemHandle | echandle* | Previous item handle | Returns true if successful, false otherwise. @@ -1361,10 +1282,10 @@ Returns true if successful, false otherwise. Gets the first item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle*|First item handle| +| Name | Type | Description | +|------------------|-----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle* | First item handle | Returns true if successful, false otherwise. @@ -1372,10 +1293,10 @@ Returns true if successful, false otherwise. Gets the last item in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle*|Last item handle| +| Name | Type | Description | +|------------------|-----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle* | Last item handle | Returns true if successful, false otherwise. @@ -1383,22 +1304,21 @@ Returns true if successful, false otherwise. Gets the number of items in the dictionary. Does not traverse dictionary or list items. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemCount|int32_t*|Number of items| +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | -Returns true. +Returns integer. ### Dictionary_Log Prints a message for the dictionary that is written to the debug log. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Format|const char*|String print format specifier| -|...||Arguments for print format specifier| +| Name | Type | Description | +|------------------|-------------|--------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Format | const char* | String print format specifier | +| ... | | Arguments for print format specifier | Returns true. @@ -1406,12 +1326,12 @@ Returns true. Prints an indented message for the dictionary that is written to the debug log. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|Depth|int32_t|Number of tabs| -|Format|const char*|String print format specifier| -|...||Arguments for print format specifier| +| Name | Type | Description | +|------------------|-------------|--------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| Depth | int32_t | Number of tabs | +| Format | const char* | String print format specifier | +| ... | | Arguments for print format specifier | Returns true. @@ -1419,44 +1339,44 @@ Returns true. TODO -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|UserPtr|void*|User data pointer| -|SourceDictionaryHandle|echandle|Source dictionary handle| -|SourceItemHandle|echandle|Source item handle| +| Name | Type | Description | +|------------------------|----------|--------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| UserPtr | void* | User data pointer | +| SourceDictionaryHandle | echandle | Source dictionary handle | +| SourceItemHandle | echandle | Source item handle | ### Dictionary_Sync TODO -|Name|Type|Description| -|-|-|-| -|TargetDictionaryHandle|echandle|Target dictionary handle| -|SourceDictionaryHandle|echandle|Source dictionary handle| -|FilterUserPtr|void*|User data pointer| -|FilterCallback|ItemFilterCallback|Callback function| +| Name | Type | Description | +|------------------------|--------------------|--------------------------| +| TargetDictionaryHandle | echandle | Target dictionary handle | +| SourceDictionaryHandle | echandle | Source dictionary handle | +| FilterUserPtr | void* | User data pointer | +| FilterCallback | ItemFilterCallback | Callback function | ### Dictionary_SyncAt TODO -|Name|Type|Description| -|-|-|-| -|TargetDictionaryHandle|echandle|Target dictionary handle| -|SourceDictionaryHandle|echandle|Source dictionary handle| -|SourceItemHandle|echandle|Source item handle| -|FilterUserPtr|void*|User data pointer| -|FilterCallback|ItemFilterCallback|Callback function| +| Name | Type | Description | +|------------------------|--------------------|--------------------------| +| TargetDictionaryHandle | echandle | Target dictionary handle | +| SourceDictionaryHandle | echandle | Source dictionary handle | +| SourceItemHandle | echandle | Source item handle | +| FilterUserPtr | void* | User data pointer | +| FilterCallback | ItemFilterCallback | Callback function | ### Dictionary_RemoveMissing Removes any items in the target dictionary which don't exist by key in the source dictionary key list. -|Name|Type|Description| -|-|-|-| -|TargetDictionaryHandle|echandle|Target dictionary handle| -|SourceDictionaryHandle|echandle|Source dictionary list handle containing list of valid keys| +| Name | Type | Description | +|------------------------|----------|-------------------------------------------------------------| +| TargetDictionaryHandle | echandle | Target dictionary handle | +| SourceDictionaryHandle | echandle | Source dictionary list handle containing list of valid keys | Returns true. @@ -1464,11 +1384,11 @@ Returns true. Merges the items from one dictionary into another. The overwrite argument determines if the source dictionary's items will overwrite existing items in the target dictionary or not. -|Name|Type|Description| -|-|-|-| -|TargetDictionaryHandle|echandle|Target dictionary handle| -|SourceDictionaryHandle|echandle|Source dictionary handle| -|OverwriteExisting|int32_t|Overwrite existing items| +| Name | Type | Description | +|------------------------|----------|--------------------------| +| TargetDictionaryHandle | echandle | Target dictionary handle | +| SourceDictionaryHandle | echandle | Source dictionary handle | +| OverwriteExisting | int32_t | Overwrite existing items | Returns true. @@ -1476,12 +1396,12 @@ Returns true. Merges the items from one dictionary into another, starting at a particular item in the source dictionary. -|Name|Type|Description| -|-|-|-| -|TargetDictionaryHandle|echandle|Target dictionary handle| -|SourceDictionaryHandle|echandle|Source dictionary handle| -|SourceItemHandle|echandle|Item to start at when copying| -|Flags|int32_t|Merge flags (See DICTIONARY_MERGE)| +| Name | Type | Description | +|------------------------|----------|------------------------------------| +| TargetDictionaryHandle | echandle | Target dictionary handle | +| SourceDictionaryHandle | echandle | Source dictionary handle | +| SourceItemHandle | echandle | Item to start at when copying | +| Flags | int32_t | Merge flags (See DICTIONARY_MERGE) | Returns true. @@ -1489,12 +1409,12 @@ Returns true. Merges a particular item from one dictionary into another. -|Name|Type|Description| -|-|-|-| -|TargetDictionaryHandle|echandle|Target dictionary handle| -|SourceDictionaryHandle|echandle|Source dictionary handle| -|SourceItemHandle|echandle|Item to copy| -|Flags|int32_t|Merge flags (See DICTIONARY_MERGE)| +| Name | Type | Description | +|------------------------|----------|------------------------------------| +| TargetDictionaryHandle | echandle | Target dictionary handle | +| SourceDictionaryHandle | echandle | Source dictionary handle | +| SourceItemHandle | echandle | Item to copy | +| Flags | int32_t | Merge flags (See DICTIONARY_MERGE) | Returns true. @@ -1502,31 +1422,29 @@ Returns true. Skips the root dictionary or list. If the dictionary is a dictionary container it will return the inner dictionary handle, otherwise it will return itself. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|DataDictionaryHandle|echandle*|Unrooted dictionary handle| +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | -Returns true. +Returns a pointer to the unrooted dictionary. ### Dictionary_SkipRootContainer Skips the root dictionary or list. If the dictionary is a dictionary _or list_ container it will return the inner dictionary handle, otherwise it will return itself. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|DataDictionaryHandle|echandle*|Unrooted dictionary handle| +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | -Returns true. +Returns a pointer to the unrooted dictionary. ### Dictionary_Reset Resets the contents of the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | Returns true. @@ -1534,9 +1452,9 @@ Returns true. Prints the contents of the dictionary to the debug log. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | Returns true. @@ -1544,10 +1462,10 @@ Returns true. Sets the case-sensitivity of the dictionary. Setting this value to true will cause searches for keys to be case-sensitive. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|CaseSensitive|int32_t|Boolean value| +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| CaseSensitive | bool | Boolean value | Returns true. @@ -1555,21 +1473,41 @@ Returns true. Gets the case-sensitivity of the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|CaseSensitive|int32_t*|Boolean value| +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | + +Returns bool. + +### Dictionary_SetPrivateKeys + +Sets whether or not private keys are supported in the dictionary. + +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| PrivateKeys | bool | Boolean value | Returns true. +### Dictionary_GetPrivateKeys + +Gets whether private keys are supported if the dictionary. + +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | + +Returns bool. + ### Dictionary_SetAllowDuplicates Sets duplicates to be allowed in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|AllowDuplicates|int32_t|Boolean value| +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| AllowDuplicates | bool | Boolean value | Returns true. @@ -1577,23 +1515,22 @@ Returns true. Gets whether or not duplicates are allowed in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|AllowDuplicates|int32_t*|Boolean value| +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | -Returns true. +Returns bool. ### Dictionary_ItemRemoveCallback Callback that is called whenever an item is removed from a dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Handle to the item being removed| -|UserPtr|void*|User data pointer| -|Path|const char*|Full path to the item being removed| +| Name | Type | Description | +|------------------|-------------|-------------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Handle to the item being removed | +| UserPtr | void* | User data pointer | +| Path | const char* | Full path to the item being removed | Returns true. @@ -1601,11 +1538,11 @@ Returns true. Sets the callback that gets triggered when an item is removed from the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|UserPtr|void*|User data pointer| -|Callback|ItemRemoveCallback|Callback function| +| Name | Type | Description | +|------------------|--------------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| UserPtr | void* | User data pointer | +| Callback | ItemRemoveCallback | Callback function | Returns true. @@ -1613,11 +1550,11 @@ Returns true. Gets the callback that gets triggered when an item is removed from the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|UserPtr|void**|User data pointer| -|Callback|ItemRemoveCallback*|Callback function| +| Name | Type | Description | +|------------------|---------------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| UserPtr | void** | User data pointer | +| Callback | ItemRemoveCallback* | Callback function | Returns true. @@ -1625,13 +1562,13 @@ Returns true. Callback that is called whenever an item's key is changed in a dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Handle to the item changed| -|UserPtr|void*|User data pointer| -|Path|const char*|Full path to the item changed| -|OldKey|const char*|Previous name of the item| +| Name | Type | Description | +|------------------|-------------|-------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Handle to the item changed | +| UserPtr | void* | User data pointer | +| Path | const char* | Full path to the item changed | +| OldKey | const char* | Previous name of the item | Returns true. @@ -1639,11 +1576,11 @@ Returns true. Sets the callback that gets triggered when an item's key is changed in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|UserPtr|void*|User data pointer| -|Callback|ItemKeyChangeCallback|Callback function| +| Name | Type | Description | +|------------------|-----------------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| UserPtr | void* | User data pointer | +| Callback | ItemKeyChangeCallback | Callback function | Returns true. @@ -1651,11 +1588,11 @@ Returns true. Gets the callback that gets triggered when an item's key is changed in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|UserPtr|void**|User data pointer| -|Callback|ItemKeyChangeCallback*|Callback function| +| Name | Type | Description | +|------------------|------------------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| UserPtr | void** | User data pointer | +| Callback | ItemKeyChangeCallback* | Callback function | Returns true. @@ -1663,14 +1600,14 @@ Returns true. Callback that is called whenever an item's value is changed in a dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|ItemHandle|echandle|Handle to the item changed| -|UserPtr|void*|User data pointer| -|Path|const char*|Full path to the item changed| -|OldValue|const char*|Previous value of item| -|OldValueLength|int32_t|Length of previous value of item| +| Name | Type | Description | +|------------------|-------------|----------------------------------| +| DictionaryHandle | echandle | Dictionary handle | +| ItemHandle | echandle | Handle to the item changed | +| UserPtr | void* | User data pointer | +| Path | const char* | Full path to the item changed | +| OldValue | const char* | Previous value of item | +| OldValueLength | int32_t | Length of previous value of item | Returns true. @@ -1678,11 +1615,11 @@ Returns true. Sets the callback that gets triggered when an item's value is changed in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|UserPtr|void*|User data pointer| -|Callback|ItemValueChangeCallback|Callback function| +| Name | Type | Description | +|------------------|-------------------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| UserPtr | void* | User data pointer | +| Callback | ItemValueChangeCallback | Callback function | Returns true. @@ -1690,11 +1627,11 @@ Returns true. Gets the callback that gets triggered when an item's value is changed in the dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| -|UserPtr|void**|User data pointer| -|Callback|ItemValueChangeCallback*|Callback function| +| Name | Type | Description | +|------------------|--------------------------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | +| UserPtr | void** | User data pointer | +| Callback | ItemValueChangeCallback* | Callback function | Returns true. @@ -1702,9 +1639,9 @@ Returns true. Translates a dictionary item type value into a string. -|Name|Type|Description| -|-|-|-| -|Type|int32_t|Item type (See DICTIONARY_TYPE)| +| Name | Type | Description | +|------|---------|---------------------------------| +| Type | int32_t | Item type (See DICTIONARY_TYPE) | Returns the string of the type. @@ -1712,24 +1649,15 @@ Returns the string of the type. Gets the key for a item path. -_Input Path_ -``` -f1.f2.key1 -``` -_Search Structure_ -```json -{ "f1": { "f2": { "key1": "val1" } } } ``` -_Expected Key_ -``` -key1 +f1.f2.key1 : { "f1": { "f2": { "key1": "val1" } } } = key1 ``` -|Name|Type|Description| -|-|-|-| -|Path|const char*|Item path| -|Key|char*|Key buffer| -|MaxKey|int32_t|Maximum length of key buffer| +| Name | Type | Description | +|--------|-------------|------------------------------| +| Path | const char* | Item path | +| Key | char* | Key buffer | +| MaxKey | int32_t | Maximum length of key buffer | Returns true if successful, false otherwise. @@ -1737,20 +1665,15 @@ Returns true if successful, false otherwise. Skips the first item in a path. -_Input Path_ -``` -f1.f2.key1 -``` -_Expected Output Path_ -``` -f2.key1 +```` +f1.f2.key1 >> f2.key1 ```` -|Name|Type|Description| -|-|-|-| -|Path|const char*|Item path| -|ChildPath|char*|Child path buffer| -|MaxChildPath|int32_t|Maximum length of child path buffer| +| Name | Type | Description | +|--------------|-------------|-------------------------------------| +| Path | const char* | Item path | +| ChildPath | char* | Child path buffer | +| MaxChildPath | int32_t | Maximum length of child path buffer | Returns true if successful, false otherwise. @@ -1758,17 +1681,16 @@ Returns true if successful, false otherwise. Gets the parent path. -_Input Paths and Expected Output Paths_ ``` f1.f2.key1 >> f1.f2 f1.f2 >> f1 ``` -|Name|Type|Description| -|-|-|-| -|Path|const char*|Item path| -|Parent|char*|Parent path buffer| -|MaxParent|int32_t|Maximum length of parent path buffer| +| Name | Type | Description | +|-----------|-------------|--------------------------------------| +| Path | const char* | Item path | +| Parent | char* | Parent path buffer | +| MaxParent | int32_t | Maximum length of parent path buffer | Returns true if successful, false otherwise. @@ -1776,16 +1698,15 @@ Returns true if successful, false otherwise. Gets whether or not the path has a parent. -_Path Inputs and Expected Outputs_ ``` f1.f2.key1 >> true f1 >> false key1 >> false ``` -|Name|Type|Description| -|-|-|-| -|Path|const char*|Item path| +| Name | Type | Description | +|------|-------------|-------------| +| Path | const char* | Item path | Returns true if item has parent, false otherwise. @@ -1793,19 +1714,15 @@ Returns true if item has parent, false otherwise. Creates a new instance of a dictionary. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle*|Dictionary handle| - -Returns true. +Returns an instance pointer. ### Dictionary_AddRef Increments the reference count of the dictionary by one. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle|Dictionary handle| +| Name | Type | Description | +|------------------|----------|-------------------| +| DictionaryHandle | echandle | Dictionary handle | Returns handle to the dictionary instance. @@ -1813,8 +1730,8 @@ Returns handle to the dictionary instance. Releases an instance of a dictionary when its reference count reaches zero. Decrements the reference count of the dictionary by one. -|Name|Type|Description| -|-|-|-| -|DictionaryHandle|echandle*|Dictionary handle| +| Name | Type | Description | +|------------------|-----------|-------------------| +| DictionaryHandle | echandle* | Dictionary handle | -Returns reference count. +Returns true. diff --git a/docs/task.md b/docs/task.md index c20760a..355021a 100644 --- a/docs/task.md +++ b/docs/task.md @@ -2,6 +2,8 @@ Tasks perform a specific action depending on the task type. These functions and the associated task interface `ITask` are used to set and retrieve information for a particular task instance. +**Interface** + - [Task\_RequireArgument](#task_requireargument) - [Task\_SubAction\_Null](#task_subaction_null) - [Task\_SubAction\_Complete](#task_subaction_complete) @@ -9,9 +11,7 @@ Tasks perform a specific action depending on the task type. These functions and - [Task\_IsCancelled](#task_iscancelled) - [Task\_GetType](#task_gettype) - [Task\_GetTimeElapsed](#task_gettimeelapsed) -- [Task\_SetName](#task_setname) - [Task\_GetName](#task_getname) -- [Task\_GetNamePtr](#task_getnameptr) - [Task\_HasArgument](#task_hasargument) - [Task\_GetArgumentPtr](#task_getargumentptr) - [Task\_GetArgumentType](#task_getargumenttype) @@ -35,7 +35,6 @@ Tasks perform a specific action depending on the task type. These functions and - [Task\_Cancel](#task_cancel) - [Task\_Dump](#task_dump) - [Task\_Log](#task_log) -- [Task\_VPrint](#task_vprint) - [Task\_VerboseLog](#task_verboselog) - [Task\_ExpandString](#task_expandstring) - [Task\_ExpandKey](#task_expandkey) @@ -55,15 +54,13 @@ Tasks perform a specific action depending on the task type. These functions and - [Task\_AddErrorFromMap](#task_adderrorfrommap) - [Task\_AddErrorFromDictionary](#task_adderrorfromdictionary) - [Task\_GetError](#task_geterror) -- [Task\_GetErrorPtr](#task_geterrorptr) - [Task\_AddWarning](#task_addwarning) - [Task\_AddWarningFromDictionary](#task_addwarningfromdictionary) - [Task\_GetWarning](#task_getwarning) -- [Task\_GetWarningPtr](#task_getwarningptr) - [Task\_ClearErrors](#task_clearerrors) - [Task\_ClearWarnings](#task_clearwarnings) - [Task\_SetVerbose](#task_setverbose) -- [Task\_GetVerbose](#task_getverbose) +- [Task\_IsVerbose](#task_isverbose) - [Task\_SetDelayedCancel](#task_setdelayedcancel) - [Task\_GetDelayedCancel](#task_getdelayedcancel) - [Task\_GetWorkflowHandle](#task_getworkflowhandle) @@ -76,12 +73,10 @@ Tasks perform a specific action depending on the task type. These functions and - [Task\_SetExpandStringCallback](#task_setexpandstringcallback) - [Task\_GetExpandStringCallback](#task_getexpandstringcallback) - [Task\_SetAuthenticateCallback](#task_setauthenticatecallback) -- [Task\_GetAuthenticateCallback](#task_getauthenticatecallback) - [Task\_GetInstanceId](#task_getinstanceid) - [Task\_AddRef](#task_addref) - [Task\_Release](#task_release) - ### Task_RequireArgument Macro that can be used to check if a required argument is not specified for a task. @@ -145,7 +140,7 @@ Gets a string containing the task's type. |-|-|-| |TaskHandle|echandle|Task handle| -Returns a string pointer that contains the task's type. +Returns a string pointer. ### Task_GetTimeElapsed @@ -154,20 +149,8 @@ Gets the amount of seconds elapsed while the task was running. |Name|Type|Description| |-|-|-| |TaskHandle|echandle|Task handle| -|ElapsedTime|float64*|Second elapsed| - -Returns true. - -### Task_SetName -Sets the name for the task. - -|Name|Type|Description| -|-|-|-| -|TaskHandle|echandle|Task handle| -|Name|const char*|Name of task| - -Returns true. +Returns `float64_t`. ### Task_GetName @@ -176,21 +159,8 @@ Gets the name of the task. |Name|Type|Description| |-|-|-| |TaskHandle|echandle|Task handle| -|Name|char*|Name buffer| -|MaxName|int32_t|Maximum length of name buffer| - -Returns true. -### Task_GetNamePtr - -Gets a string pointer to the name of the task. - -|Name|Type|Description| -|-|-|-| -|TaskHandle|echandle|Task handle| -|NamePtr|const char**|Name buffer pointer| - -Returns true. +Returns string. ### Task_HasArgument @@ -254,19 +224,19 @@ Gets the expanded string value of an argument in the task. If the argument is a Returns true if argument exists, false otherwise. _Task_ -```json +``` "runMyTask": { "type": "myTask", "value": [ "-arg1=test", "--arg2=test3" ] } ``` _Code_ -```c +``` char Value[1024] = { 0 }; -Task_GetMultiStringArgument(TaskHandle, "value", Value, Element_Count(Value)); +Task_GetMultiStringArgument(TaskHandle, "value", Value, sizeof(Value)); ``` _Result_ -```bash +``` "--arg1=test" "--arg2=test3" ``` @@ -361,11 +331,11 @@ Sets a status item in the status dictionary with a string value for the task. Returns true if successful, false otherwise. -```c +``` Task_SetStatusString(TaskHandle, "trayStatus", "UI_Initializing") ``` _Status Dictionary:_ -```json +``` { "status": "UI_Processing", "trayStatus": "UI_Initializing" @@ -384,11 +354,11 @@ Sets a status item in the status dictionary with a number value for the task. Returns true if successful, false otherwise. -```c +``` Task_SetStatusString(TaskHandle, "trayProcessed", 1020) ``` _Status Dictionary:_ -```json +``` { "status": "UI_Processing", "trayStatus": "UI_Initializing", @@ -448,7 +418,7 @@ Runs a task subaction and calls a callback when complete. Subactions are names o In the example below, _isReady_ is the name of the subaction and it references another task called _doOurThing_. -```json +``` "checkIfReady": { "type": "readyCheck", "path": "c:\\pathToCheck.exe", @@ -544,22 +514,10 @@ Prints a message for the task to the debug log. Returns true. -```c +``` Task_Log(TaskHandle, "Hello %s", "world"); ``` -### Task_VPrint - -Prints a message for the task to the debug log using a variable argument list. - -|Name|Type|Description| -|-|-|-| -|TaskHandle|echandle|Task handle| -|Format|const char*|Print format specifier string| -|ArgumentList|va_list|Argument list for print format specifier string| - -Returns true. - ### Task_VerboseLog Prints a message for the task to the debug log when verbose is enabled. @@ -780,7 +738,7 @@ Adds the error from the task's error map specified by the exit code. Returns true. _Task_: -```json +``` "myTask": { "type": "uberTask", "errorCodeMap": { @@ -790,11 +748,11 @@ _Task_: } ``` _Code_: -```c +``` Task_AddErrorFromMap(TaskHandle, "404", "UI_WhoKnows") ``` _Result Equivalent_: -```c +``` Task_AddError(TaskHandle, "UI_NotFound") ``` @@ -817,22 +775,8 @@ Gets the error string at the specified index in the task's error list. |-|-|-| |TaskHandle|echandle|Task handle| |Index|int32_t|Error index| -|Error|char*|Error string buffer| -|MaxError|int32_t|Maximum length of error string buffer| - -Returns true if index exists, false otherwise. -### Task_GetErrorPtr - -Gets a error string pointer at the specified index in the task's error list. - -|Name|Type|Description| -|-|-|-| -|TaskHandle|echandle|Task handle| -|Index|int32_t|Error index| -|ErrorPtr|const char**|Error string pointer| - -Returns true if index exists, false otherwise. +Returns string if index exists, false otherwise. ### Task_AddWarning @@ -865,22 +809,8 @@ Gets the warning string at the specified index in the task's warning list. |-|-|-| |TaskHandle|echandle|Task handle| |Index|int32_t|Warning index| -|Warning|char*|Warning string buffer| -|MaxWarning|int32_t|Maximum length of warning string buffer| - -Returns true if index exists, false otherwise. - -### Task_GetWarningPtr - -Gets a warning string pointer at the specified index in the task's warning list. -|Name|Type|Description| -|-|-|-| -|TaskHandle|echandle|Task handle| -|Index|int32_t|Warning index| -|WarningPtr|const char**|Warning string pointer| - -Returns true if index exists, false otherwise. +Returns string if index exists, false otherwise. ### Task_ClearErrors @@ -913,16 +843,15 @@ Enables or disables verbose logging for the task. Returns true. -### Task_GetVerbose +### Task_IsVerbose Gets whether or not verbose logging is enabled for the task. |Name|Type|Description| |-|-|-| |TaskHandle|echandle|Task handle| -|Verbose|int32_t*|Enable boolean value| -Returns true. +Returns bool. ### Task_SetDelayedCancel @@ -942,9 +871,8 @@ Gets whether or not delayed cancel is enabled on the task. |Name|Type|Description| |-|-|-| |TaskHandle|echandle|Task handle| -|DelayedCancel|int32_t*|Delayed cancel enabled boolean| -Returns true. +Returns bool. ### Task_GetWorkflowHandle @@ -953,9 +881,8 @@ Gets the workflow handle for the task. |Name|Type|Description| |-|-|-| |TaskHandle|echandle|Task handle| -|WorkflowHandle|echandle*|Workflow handle| -Returns true. +Returns a workflow handle. ### Task_GetDictionaryHandle @@ -964,9 +891,8 @@ Gets the dictionary handle for the task. The task dictionary contains the argume |Name|Type|Description| |-|-|-| |TaskHandle|echandle|Task handle| -|DictionaryHandle|echandle*|Argument dictionary handle| -Returns true. +Returns a dictionary handle. ### Task_GetStatusDictionaryHandle @@ -975,9 +901,8 @@ Gets the status dictionary handle for the task. The status dictionary contains s |Name|Type|Description| |-|-|-| |TaskHandle|echandle|Task handle| -|DictionaryHandle|echandle*|Status dictionary handle| -Returns true. +Returns a dictionary handle. ### Task_GetCertStoreListHandle @@ -986,9 +911,8 @@ Gets the list of certificate stores for the task's "store" argument. |Name|Type|Description| |-|-|-| |TaskHandle|echandle|Task handle| -|CertStoreListHandle|echandle*|Certificate store dictionary list handle| -Returns true. +Returns a dictionary list handle. ### Task_SetDefaultCertStore @@ -1008,10 +932,8 @@ Gets the default certificate store for the task. |Name|Type|Description| |-|-|-| |TaskHandle|echandle|Task handle| -|DefaultCertStore|char*|Default certificate store buffer| -|MaxDefaultCertStore|int32_t|Maximum length of default certificate store buffer| -Returns true. +Returns string. ### Task_ExpandStringCallback @@ -1063,18 +985,6 @@ Sets the authenticate callback to determine whether or not the task should authe Returns true. -### Task_GetAuthenticateCallback - -Gets the authenticate callback for the task. - -|Name|Type|Description| -|-|-|-| -|TaskHandle|echandle|Task handle| -|UserPtr|void**|User data pointer| -|Callback|AuthenticateCallback*|Authenticate callback| - -Returns true. - ### Task_GetInstanceId Gets the instance id for the task. @@ -1082,10 +992,8 @@ Gets the instance id for the task. |Name|Type|Description| |-|-|-| |TaskHandle|echandle|Task handle| -|InstanceId|char*|Instance id string buffer| -|MaxInstanceId|int32_t|Maximum length of instance id string buffer| -Returns true. +Returns a string. ### Task_AddRef diff --git a/docs/workflow.md b/docs/workflow.md new file mode 100644 index 0000000..3aad2d7 --- /dev/null +++ b/docs/workflow.md @@ -0,0 +1,717 @@ +## Workflow + +The workflow header and interface provides functions for operating on workflow instances. The workflow engine can run multiple workflows. + +It is possible for one workflow to run another workflow using the _workflowRun_ task. In this instance, the two workflows have a parent/child relationship. Workflows that have no parent are considered global workflows. + +**Interface** + +- [Workflow\_HasTask](#workflow_hastask) +- [Workflow\_HasRemoteTask](#workflow_hasremotetask) +- [Workflow\_HasRemoteWorkflow](#workflow_hasremoteworkflow) +- [Workflow\_FindTaskByInstanceId](#workflow_findtaskbyinstanceid) +- [Workflow\_FindTaskByName](#workflow_findtaskbyname) +- [Workflow\_GetParentTaskHandle](#workflow_getparenttaskhandle) +- [Workflow\_GetParentTaskHandleByName](#workflow_getparenttaskhandlebyname) +- [Workflow\_FindTaskHandler](#workflow_findtaskhandler) +- [Workflow\_RegisterTaskHandler](#workflow_registertaskhandler) +- [Workflow\_UnregisterTaskHandler](#workflow_unregistertaskhandler) +- [Workflow\_SetStatus](#workflow_setstatus) +- [Workflow\_SetStatusString](#workflow_setstatusstring) +- [Workflow\_SetStatusNumber](#workflow_setstatusnumber) +- [Workflow\_SetStatusWithDictionary](#workflow_setstatuswithdictionary) +- [Workflow\_CanCreateTask](#workflow_cancreatetask) +- [Workflow\_CreateTask](#workflow_createtask) +- [Workflow\_CompleteCallback](#workflow_completecallback) +- [Workflow\_RunTask](#workflow_runtask) +- [Workflow\_QueueTask](#workflow_queuetask) +- [Workflow\_CancelTasks](#workflow_canceltasks) +- [Workflow\_ClearTasks](#workflow_cleartasks) +- [Workflow\_ClearTasksByHandle](#workflow_cleartasksbyhandle) +- [Workflow\_IsTaskRunning](#workflow_istaskrunning) +- [Workflow\_IsTaskQueued](#workflow_istaskqueued) +- [Workflow\_IsActivated](#workflow_isactivated) +- [Workflow\_Complete](#workflow_complete) +- [Workflow\_Reset](#workflow_reset) +- [Workflow\_AddMacro](#workflow_addmacro) +- [Workflow\_ExpandString](#workflow_expandstring) +- [Workflow\_ExpandKey](#workflow_expandkey) +- [Workflow\_LoadFile](#workflow_loadfile) +- [Workflow\_LoadBuffer](#workflow_loadbuffer) +- [Workflow\_LoadDictionary](#workflow_loaddictionary) +- [Workflow\_RegisterDefaultTasks](#workflow_registerdefaulttasks) +- [Workflow\_RegisterCustomTasks](#workflow_registercustomtasks) +- [Workflow\_UnregisterDefaultTasks](#workflow_unregisterdefaulttasks) +- [Workflow\_UnregisterCustomTasks](#workflow_unregistercustomtasks) +- [Workflow\_Log](#workflow_log) +- [Workflow\_VerboseLog](#workflow_verboselog) +- [Workflow\_IsGlobal](#workflow_isglobal) +- [Workflow\_SetVerbose](#workflow_setverbose) +- [Workflow\_IsVerbose](#workflow_isverbose) +- [Workflow\_GetRemoteInstanceId](#workflow_getremoteinstanceid) +- [Workflow\_ExpandStringCallback](#workflow_expandstringcallback) +- [Workflow\_SetExpandStringCallback](#workflow_setexpandstringcallback) +- [Workflow\_GetMacroDictionaryHandle](#workflow_getmacrodictionaryhandle) +- [Workflow\_GetDictionaryHandle](#workflow_getdictionaryhandle) +- [Workflow\_GetStatusDictionaryHandle](#workflow_getstatusdictionaryhandle) +- [Workflow\_GetCertStoreListHandle](#workflow_getcertstorelisthandle) +- [Workflow\_GetInstanceId](#workflow_getinstanceid) +- [Workflow\_AddRef](#workflow_addref) +- [Workflow\_Release](#workflow_release) +- [Workflow\_RegisterTask](#workflow_registertask) +- [Workflow\_UnregisterTask](#workflow_unregistertask) + +### Workflow_HasTask + +Gets whether or not the task instance is associated with the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|InstanceId|const char*|Task instance id| + +Returns true if the task instance is associated with the workflow, false otherwise. + +### Workflow_HasRemoteTask + +Gets whether or not the remote task instance is associated with the workflow. Remote tasks are those that are run by a remote workflow engine process. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|InstanceId|const char*|Task instance id| + +Returns true if the remote task instance is associated with the workflow, false otherwise. + +### Workflow_HasRemoteWorkflow + +Gets whether or not the remote workflow instance is associated with the workflow. Remote workflows are those that are run by a remote workflow engine process and initialated by _workflowRun_ tasks in the current workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|InstanceId|const char*|Task instance id| + +Returns true if the remote workflow instance is associated with teh workflow, false otherwise. + +### Workflow_FindTaskByInstanceId + +Finds the task handle with the specified instance id in the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|InstanceId|const char*|Task instance id| +|TaskHandle|echandle*|Task handle| + +Returns true if the task was found, false otherwise. + +### Workflow_FindTaskByName + +Finds the task handle with the specified name in the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Name|const char*|Task name| +|TaskHandle|echandle*|Task handle| + +Returns true if the task was found, false otherwise. + +### Workflow_GetParentTaskHandle + +Gets the parent task handle for the specified task handle in the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|TaskHandle|echandle|Task handle| +|ParentTaskHandle|echandle*|Parent task handle| + +Returns true if the task has a parent task handle, false otherwise. + +### Workflow_GetParentTaskHandleByName + +Gets the parent task handle with the specified name for the specified task handle in the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|TaskHandle|echandle|Task handle| +|Name|const char*|Parent task name| +|ParentTaskHandle|echandle*|Parent task handle| + +Returns true if the parent task was found, false otherwise. + +### Workflow_FindTaskHandler + +Finds the task handler interface for the specified task type in the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Type|const char*|Task type name| +|Interface|ITask**|Task handler interface| + +Returns true if found, false otherwise. + +### Workflow_RegisterTaskHandler + +Registers the task handler for a particular task type in the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Interface|ITask*|Task handler interface| + +Returns true. + +### Workflow_UnregisterTaskHandler + +Unregisters the task handle for a particular task type in the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Interface|ITask*|Task handler interface| + +Returns true. + +### Workflow_SetStatus + +Sets the "status" string for the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Status|const char*|Status string| + +Returns true if successful, false otherwise. + +**Notes:** + +* Each workflow (and task) has a status dictionary associated with it and this function sets the "status" key of that dictionary. +* Usually the status is a localization id that the UI translate for the display language selected. + +### Workflow_SetStatusString + +Sets a status item in the status dictionary with a string value for the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Name|const char*|Name of the status item| +|Value|const char*|Value of the status item| + +Returns true if successful, false otherwise. + +``` +Workflow_SetStatusString(WorkflowHandle, "specialStatus", "UI_Initializing") +``` +_Status Dictionary:_ +``` +{ + "status": "UI_Processing", + "specialStatus": "UI_Initializing" +} +``` + +### Workflow_SetStatusNumber + +Sets a status item in the status dictionary with a number value for the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Name|const char*|Name of the status item| +|Value|float64|64-bit floating point integer of the status item| + +Returns true if successful, false otherwise. + +### Workflow_SetStatusWithDictionary + +Merges and overwrites dictionary items into the status dictionary for the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Name|const char*|Name of the status item| +|DictionaryHandle|echandle|Source status dictionary handle| + +Returns true. + +### Workflow_CanCreateTask + +Gets whether or not the workflow can create the task specified by name. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Name|const char*|Task name| + +Returns true if the workflow knows about and can create the specified task, false otherwise. + +### Workflow_CreateTask + +Creates a task instance with the specified name in the workflow. The task name should exist in the workflow dictionary. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Name|const char*|Task name| +|DictionaryHandle|echandle|Additional task argument dictionary handle| +|ParentTaskHandle|echandle|Parent task handle or NULL| +|TaskHandle|echandle*|Handle to task that is created| + +Returns true if the task is created, false otherwise. + +### Workflow_CompleteCallback + +Callback that is triggered when a workflow event completes. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|UserPtr|void*|User data pointer| +|DictionaryHandle|echandle|Complete info dictionary handle| + +Return true. + +**Notes:** + +* If the event is successful, the complete info dictionary will contain "successful" boolean key set to true. + +### Workflow_RunTask + +Immediately runs the task specified by name in the workflow. When the task is complete, the specified complete callback is called. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Name|const char*|Task name| +|ParentTaskHandle|echandle|Parent task handle or NULL| +|UserPtr|void*|User data pointer| +|Callback|CompleteCallback|Complete callback function| + +Returns true. + +**Notes:** + +* Using this function can cause multiple tasks to run at the same time. It is not ideal for tasks that update the UI, but can be useful for tasks that need to run immediately such as launching an executable. + +### Workflow_QueueTask + +Queues the task specified by name in the workflow. When the task is complete, the specified complete callback is called. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Name|const char*|Task name| +|ParentTaskHandle|echandle|Parent task handle or NULL| +|UserPtr|void*|User data pointer| +|Callback|CompleteCallback|Complete callback function| + +Returns true. + +**Notes:** + +* The task will be run when there are no other tasks running. + +### Workflow_CancelTasks + +Cancels all the tasks in the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns true. + +### Workflow_ClearTasks + +Clears all the tasks in the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns true. + +### Workflow_ClearTasksByHandle + +Clears the task specified by its task handle in the workflow. The child-most task in the chain is cancelled first, and the cancellation bubbles up. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|TaskHandle|echandle|Task handle| + +Returns true. + +### Workflow_IsTaskRunning + +Gets whether or not the task specified by name is running in the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Name|const char*|Task name| + +Returns true if the task is running, false otherwise. + +### Workflow_IsTaskQueued + +Gets whether or not the task specified by name is queued and waiting to be run in the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Name|const char*|Task name| + +Returns true if the task is queued, false otherwise. + +### Workflow_IsActivated + +Gets whether or not the workflow has any events that are running or ready to be run. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns true if the workflow has tasks running or ready to be run. + +### Workflow_Complete + +Completes the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|DictionaryHandle|echandle|Complete info dictionary handle| + +Returns true. + +### Workflow_Reset + +Resets the workflow instance. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns true. + +### Workflow_AddMacro + +Adds a macro key and value to the workflow's macros list. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Key|const char*|Macro name| +|Value|const char*|Macro value| + +Returns true. + +### Workflow_ExpandString + +Expands a string in the context of the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|String|char*|Expansion buffer| +|MaxString|int32_t|Maximum length of expansion buffer| + +Returns true. + +**Notes:** + +* Expands strings using the workflow's macros specified in the macro dictionary. + +### Workflow_ExpandKey + +Expands a macro key and value in the context of the workflow. The _ExpandKey_ function may call the _Workflow_ExpandStringCallback_ in order to evaluate certain keys in the workflow. + +|Name|Type|Description| +|-|-|-| +|UserPtr|void*|User data pointer| +|Key|const char*|Macro key| +|Value|const char*|Macro key value| +|Buffer|char*|Expansion buffer| +|MaxBuffer|int32_t|Maximum length of expansion buffer| + +Returns true. + +### Workflow_LoadFile + +Loads a workflow JSON file from disk. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Path|const char*|Path to the JSON workflow| + +Returns true if successful, false otherwise. + +### Workflow_LoadBuffer + +Loads a workflow JSON from a memory buffer. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Buffer|const char*|JSON string buffer| +|BufferSize|int32_t|JSON string buffer length| +|Merge|int32_t|Merge boolean| + +Returns true if successful, false otherwise. + +**Notes:** + +* When merge is enabled, it will merge the specified JSON dictionary with the current workflow's dictionary. + +### Workflow_LoadDictionary + +Loads a workflow from a dictionary. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|DictionaryHandle|echandle|Tasks dictionary handle| +|Merge|int32_t|Merge boolean| + +**Notes:** + +* When merge is enabled, it will merge the specified dictionary with the current workflow's dictionary. + +### Workflow_RegisterDefaultTasks + +Registers the default task handlers for the workflow engine. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns true. + +### Workflow_RegisterCustomTasks + +Triggers the registration of custom tasks for the workflow. The _Workflow.RegisterTaskHandlers_ notification will be fired, in which case custom interop can observer it and call _IWorkflow_RegisterTaskHandler_ to register their customer tasks. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns true. + +### Workflow_UnregisterDefaultTasks + +Unregisters the default task handlers for the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns true. + +### Workflow_UnregisterCustomTasks + +Triggers the unregistration of custom tasks for the workflow. The _Workflow.UnregisterTaskHandlers_ notification will be fired, in which case custom interop can observer it and call _IWorkflow_UnregisterTaskHandler_ to unregister their custom task types. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns true. + + +### Workflow_Log + +Prints a message for the workflow to the debug log. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Format|const char*|Print format specifier string| +|...||Arguments for print format specifier string| + +Returns true. + +``` +Workflow_Log(WorkflowHandle, "Hello %s", "world"); +``` + +### Workflow_VerboseLog + +Prints a message for the workflow to the debug log when verbose is enabled. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Format|const char*|Print format specifier string| +|...||Arguments for print format specifier string| + +Returns true. + +**Notes:** + +* To turn on verbose messaging you can set call _Workflow_SetVerbose_. + +### Workflow_IsGlobal + +Gets whether or not the workflow is global. A workflow is global if it has no parent workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns true if the workflow is global, false otherwise. + +### Workflow_SetVerbose + +Enables or disables verbose logging for the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Verbose|int32_t|Enable boolean value| + +Returns true. + +### Workflow_IsVerbose + +Gets whether or not verbose logging is enabled for the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns bool. + +### Workflow_GetRemoteInstanceId + +Gets the remote instance id for the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns string. + +### Workflow_ExpandStringCallback + +Callback used for expanding keys on the workflow with _Workflow_ExpandKey_ and _Workflow_ExpandString_. + +|Name|Type|Description| +|WorkflowHandle|echandle|Workflow handle| +|UserPtr|void*|User data pointer| +|Key|const char*|Key to expand| +|Buffer|char*|Expansion buffer| +|MaxBuffer|int32_t|Maximum length of expansion buffer| + +Return true if the key was expanded, false otherwise. + +### Workflow_SetExpandStringCallback + +Sets the string expansion callback for the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|UserPtr|void*|User data pointer| +|Callback|ExpandStringCallback|String expansion callback| + +Returns true. + +### Workflow_GetMacroDictionaryHandle + +Gets the dictionary handle containing macros for the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns a dictionary handle. + +### Workflow_GetDictionaryHandle + +Gets the dictionary handle for the workflow. The workflow dictionary contains the tasks and their arguments for the entire workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns a dictionary handle. + +### Workflow_GetStatusDictionaryHandle + +Gets the status dictionary handle for the workflow. The status dictionary contains status items for the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns a dictionary handle. + +### Workflow_GetCertStoreListHandle + +Gets the list of certificate stores for the workflow. The workflow's certificate store list is loaded using the _certStoreLoad_ task. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns a dictionary handle. + +### Workflow_GetInstanceId + +Gets the instance id for the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns a string. + +### Workflow_AddRef + +Increments reference count for the workflow. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| + +Returns the workflow handle. + +### Workflow_Release + +Decrements reference count for the workflow. When the count reaches zero, the workflow is deleted from memory. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle*|Workflow handle pointer| + +Returns true. + +### Workflow_RegisterTask + +Macro for registering task interface. Used in conjunction with ITask_Define. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Task|const char*|Name of task class| + +Returns true. + +### Workflow_UnregisterTask + +Macro for unregistering task interface. Used in conjunction with ITask_Define. + +|Name|Type|Description| +|-|-|-| +|WorkflowHandle|echandle|Workflow handle| +|Task|const char*|Name of task class| + +Returns true. diff --git a/interoplib.c b/interoplib.c index f8da208..4435766 100644 --- a/interoplib.c +++ b/interoplib.c @@ -109,7 +109,7 @@ typedef char *(*Class_ConvertToInstanceIdCallback)(void *Pointer); typedef bool (*Class_TrackInstanceCallback)(void *Pointer, const char *InstanceId); typedef bool (*Class_UntrackInstanceCallback)(void *Pointer); -typedef bool (*Dictionary_CreateCallback)(echandle *DictionaryHandle); +typedef echandle (*Dictionary_CreateCallback)(void); typedef int32_t (*Dictionary_ReleaseCallback)(echandle *DictionaryHandle); typedef bool (*NotificationCenter_AddInstanceObserverCallback)(const char *Type, const char *Notification, @@ -174,8 +174,8 @@ bool Class_UntrackInstance(void *Pointer) { return GlobalInteropLib.Class_UntrackInstance(Pointer); } -bool Dictionary_Create(echandle *DictionaryHandle) { - return GlobalInteropLib.Dictionary_Create(DictionaryHandle); +echandle Dictionary_Create(void) { + return GlobalInteropLib.Dictionary_Create(); } int32_t Dictionary_Release(echandle *DictionaryHandle) { diff --git a/interoplib.h b/interoplib.h index 808cdbe..a7e7aeb 100644 --- a/interoplib.h +++ b/interoplib.h @@ -28,8 +28,8 @@ typedef uint64_t time64_t; typedef struct ClassStruct { char InstanceId[36]; uint32_t Id; - int32_t RefCount; - bool (*Reserved)(echandle *ClassHandle); + volatile int32_t RefCount; + bool (*Delete)(echandle *ClassHandle); } ClassStruct; #define Class_Id(CLASS) (((ClassStruct *)(CLASS))->Id) @@ -64,7 +64,7 @@ char *Class_ConvertToInstanceId(void *Pointer); bool Class_TrackInstance(void *Pointer, const char *InstanceId); bool Class_UntrackInstance(void *Pointer); -bool Dictionary_Create(echandle *DictionaryHandle); +echandle Dictionary_Create(void); int32_t Dictionary_Release(echandle *DictionaryHandle); bool NotificationCenter_AddObserver(const char *Type, const char *Notification, void *UserPtr, diff --git a/taski.h b/taski.h index a3f7873..b8a9f61 100644 --- a/taski.h +++ b/taski.h @@ -1,7 +1,5 @@ #pragma once -/*********************************************************************/ - #ifdef __cplusplus extern "C" { #endif @@ -10,7 +8,7 @@ extern "C" { typedef struct ITask { const char *Type; - bool (*Create)(echandle *Handle, echandle TaskHandle); + echandle (*Create)(echandle TaskHandle); echandle (*AddRef)(echandle Handle); int32_t (*Release)(echandle *Handle); } ITask; @@ -35,14 +33,13 @@ typedef struct ITaskVtbl { bool (*IsCancelled)(echandle TaskHandle); const char *(*GetType)(echandle TaskHandle); - bool (*GetTimeElapsed)(echandle TaskHandle, float64_t *ElapsedTime); - bool (*GetName)(echandle TaskHandle, char *Name, int32_t MaxName); - bool (*GetNamePtr)(echandle TaskHandle, const char **NamePtr); + float64_t (*GetTimeElapsed)(echandle TaskHandle); + const char *(*GetName)(echandle TaskHandle); bool (*HasArgument)(echandle TaskHandle, const char *Name); bool (*GetArgumentPtr)(echandle TaskHandle, const char *Name, const char **ValuePtr); bool (*GetArgumentType)(echandle TaskHandle, const char *Name, int32_t *Type); bool (*GetStringArgument)(echandle TaskHandle, const char *Name, char *Value, int32_t MaxValue); - bool (*GetMultiStringArgument)(echandle TaskHandle, char *Name, char *Value, int32_t MaxValue); + bool (*GetMultiStringArgument)(echandle TaskHandle, const char *Name, char *Value, int32_t MaxValue); bool (*GetBooleanArgument)(echandle TaskHandle, const char *Name, bool *Value); bool (*GetNumberArgument)(echandle TaskHandle, const char *Name, float64_t *Value); bool (*SetStatus)(echandle TaskHandle, const char *Status); @@ -60,7 +57,6 @@ typedef struct ITaskVtbl { bool (*Cancel)(echandle TaskHandle); bool (*Dump)(echandle TaskHandle); bool (*Log)(echandle TaskHandle, const char *Format, ...); - bool (*VPrint)(echandle TaskHandle, int32_t Depth, const char *Format, va_list ArgumentLst); bool (*VerboseLog)(echandle TaskHandle, int32_t Level, const char *Format, ...); bool (*ExpandString)(echandle TaskHandle, char *String, int32_t MaxString); @@ -72,21 +68,21 @@ typedef struct ITaskVtbl { int32_t (*GetWarningCount)(echandle TaskHandle); bool (*AddError)(echandle TaskHandle, const char *Format, ...); bool (*AddErrorFromMap)(echandle TaskHandle, int32_t ExitCode, const char *DefaultExitCodeString); - bool (*GetError)(echandle TaskHandle, int32_t Index, char *Error, int32_t MaxError); + const char *(*GetError)(echandle TaskHandle, int32_t Index); bool (*AddWarning)(echandle TaskHandle, const char *Format, ...); - bool (*GetWarning)(echandle TaskHandle, int32_t Index, char *Warning, int32_t MaxWarning); + const char *(*GetWarning)(echandle TaskHandle, int32_t Index); bool (*ClearErrors)(echandle TaskHandle); bool (*ClearWarnings)(echandle TaskHandle); bool (*SetDelayedCancel)(echandle TaskHandle, bool DelayedCancel); - bool (*GetDelayedCancel)(echandle TaskHandle, bool *DelayedCancel); - bool (*GetWorkflowHandle)(echandle TaskHandle, echandle *WorkflowHandle); - bool (*GetDictionaryHandle)(echandle TaskHandle, echandle *DictionaryHandle); - bool (*GetStatusDictionaryHandle)(echandle TaskHandle, echandle *DictionaryHandle); + bool (*GetDelayedCancel)(echandle TaskHandle); + echandle (*GetWorkflowHandle)(echandle TaskHandle); + echandle (*GetDictionaryHandle)(echandle TaskHandle); + echandle (*GetStatusDictionaryHandle)(echandle TaskHandle); bool (*SetExpandStringCallback)(echandle TaskHandle, void *UserPtr, ITask_ExpandStringCallback Callback); bool (*GetExpandStringCallback)(echandle TaskHandle, void **UserPtr, ITask_ExpandStringCallback *Callback); - bool (*RequestURL)(echandle TaskHandle, char *URL, void *UserPtr, ITask_RequestCompleteCallback Callback); + bool (*RequestURL)(echandle TaskHandle, const char *URL, void *UserPtr, ITask_RequestCompleteCallback Callback); bool (*RunSubActionNext)(echandle TaskHandle, const char *Name, echandle PreviousCompleteDictionaryHandle, void *UserPtr, ITask_CompleteCallback Callback); @@ -94,27 +90,26 @@ typedef struct ITaskVtbl { /*********************************************************************/ -#define ITask_RequireArgument(HND, NAME) \ - if (ITask_HasArgument(HND, NAME) == false) { \ - ITask_Log(HND, #NAME " argument not defined\n"); \ - ITask_AddError(HND, "Task_Error_MissingArg"); \ - ITask_Complete(HND, NULL); \ - return true; \ +#define ITask_RequireArgument(HND, NAME) \ + if (!ITask_HasArgument(HND, NAME)) { \ + ITask_Log(HND, #NAME " argument not defined"); \ + ITask_AddError(HND, "Task_Error_MissingArg"); \ + ITask_Complete(HND, NULL); \ + return true; \ } -#define ITask_SubAction_Null(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->SubAction_Null -#define ITask_SubAction_Complete(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->SubAction_Complete +#define ITask_SubAction_Null(TaskHandle) \ + Class_VtblCast(TaskHandle, ITaskVtbl)->SubAction_Null(TaskHandle, UserPtr, DictionaryHandle) +#define ITask_SubAction_Complete(TaskHandle) \ + Class_VtblCast(TaskHandle, ITaskVtbl)->SubAction_Complete(TaskHandle, UserPtr, DictionaryHandle) -#define ITask_IsCompleted(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->IsCompleted(TaskHandle) -#define ITask_IsCancelled(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->IsCancelled(TaskHandle) +#define ITask_IsCompleted(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->IsCompleted(TaskHandle) +#define ITask_IsCancelled(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->IsCancelled(TaskHandle) -#define ITask_GetType(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetType(TaskHandle) -#define ITask_GetTimeElapsed(TaskHandle, ElapsedTime) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->GetTimeElapsed(TaskHandle, ElapsedTime) -#define ITask_GetName(TaskHandle, Name, MaxName) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->GetName(TaskHandle, Name, MaxName) -#define ITask_GetNamePtr(TaskHandle, NamePtr) Class_VtblCast(TaskHandle, ITaskVtbl)->GetName(TaskHandle, NamePtr) -#define ITask_HasArgument(TaskHandle, Name) Class_VtblCast(TaskHandle, ITaskVtbl)->HasArgument(TaskHandle, Name) +#define ITask_GetType(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetType(TaskHandle) +#define ITask_GetTimeElapsed(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetTimeElapsed(TaskHandle) +#define ITask_GetName(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetName(TaskHandle) +#define ITask_HasArgument(TaskHandle, Name) Class_VtblCast(TaskHandle, ITaskVtbl)->HasArgument(TaskHandle, Name) #define ITask_GetArgumentPtr(TaskHandle, Name, ValuePtr) \ Class_VtblCast(TaskHandle, ITaskVtbl)->GetArgumentPtr(TaskHandle, Name, ValuePtr) #define ITask_GetArgumentType(TaskHandle, Name, Type) \ @@ -150,8 +145,6 @@ typedef struct ITaskVtbl { #define ITask_Cancel(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->Cancel(TaskHandle) #define ITask_Dump(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->Dump(TaskHandle) #define ITask_Log(TaskHandle, Format, ...) Class_VtblCast(TaskHandle, ITaskVtbl)->Log(TaskHandle, Format, ##__VA_ARGS__) -#define ITask_VPrint(TaskHandle, Depth, Format, ArgumentList) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->VPrint(TaskHandle, Depth, Format, ArgumentList) #define ITask_VerboseLog(TaskHandle, Level, Format, ...) \ Class_VtblCast(TaskHandle, ITaskVtbl)->VerboseLog(TaskHandle, Level, Format, ##__VA_ARGS__) #define ITask_ExpandString(TaskHandle, String, MaxString) \ @@ -160,31 +153,28 @@ typedef struct ITaskVtbl { #define ITask_LoadFromDictionary(TaskHandle, DictionaryHandle, Path) \ Class_VtblCast(TaskHandle, ITaskVtbl)->LoadFromDictionary(TaskHandle, DictionaryHandle, Path) +#define ITask_HasError(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->HasError(TaskHandle) +#define ITask_HasWarning(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->HasWarning(TaskHandle) #define ITask_GetErrorCount(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetErrorCount(TaskHandle) #define ITask_GetWarningCount(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetWarningCount(TaskHandle) #define ITask_AddError(TaskHandle, Format, ...) \ Class_VtblCast(TaskHandle, ITaskVtbl)->AddError(TaskHandle, Format, ##__VA_ARGS__) #define ITask_AddErrorFromMap(TaskHandle, ExitCode, DefaultExitCodeString) \ Class_VtblCast(TaskHandle, ITaskVtbl)->AddErrorFromMap(TaskHandle, ExitCode, DefaultExitCodeString) -#define ITask_GetError(TaskHandle, Index, Error, MaxError) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->GetError(TaskHandle, Index, Error, MaxError) +#define ITask_GetError(TaskHandle, Index) Class_VtblCast(TaskHandle, ITaskVtbl)->GetError(TaskHandle, Index) #define ITask_AddWarning(TaskHandle, Format, ...) \ Class_VtblCast(TaskHandle, ITaskVtbl)->AddWarning(TaskHandle, Format, ##__VA_ARGS__) -#define ITask_GetWarning(TaskHandle, Index, Warning, MaxWarning) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->GetWarning(TaskHandle, Index, Warning, MaxWarning) -#define ITask_ClearErrors(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->ClearErrors(TaskHandle) -#define ITask_ClearWarnings(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->ClearWarnings(TaskHandle) +#define ITask_GetWarning(TaskHandle, Index) Class_VtblCast(TaskHandle, ITaskVtbl)->GetWarning(TaskHandle, Index) +#define ITask_ClearErrors(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->ClearErrors(TaskHandle) +#define ITask_ClearWarnings(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->ClearWarnings(TaskHandle) #define ITask_SetDelayedCancel(TaskHandle, DelayedCancel) \ Class_VtblCast(TaskHandle, ITaskVtbl)->SetDelayedCancel(TaskHandle, DelayedCancel) -#define ITask_GetDelayedCancel(TaskHandle, DelayedCancel) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->GetDelayedCancel(TaskHandle, DelayedCancel) -#define ITask_GetWorkflowHandle(TaskHandle, WorkflowHandle) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->GetWorkflowHandle(TaskHandle, WorkflowHandle) -#define ITask_GetDictionaryHandle(TaskHandle, DictionaryHandle) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->GetDictionaryHandle(TaskHandle, DictionaryHandle) -#define ITask_GetStatusDictionaryHandle(TaskHandle, DictionaryHandle) \ - Class_VtblCast(TaskHandle, ITaskVtbl)->GetStatusDictionaryHandle(TaskHandle, DictionaryHandle) +#define ITask_GetDelayedCancel(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetDelayedCancel(TaskHandle) +#define ITask_GetWorkflowHandle(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetWorkflowHandle(TaskHandle) +#define ITask_GetDictionaryHandle(TaskHandle) Class_VtblCast(TaskHandle, ITaskVtbl)->GetDictionaryHandle(TaskHandle) +#define ITask_GetStatusDictionaryHandle(TaskHandle) \ + Class_VtblCast(TaskHandle, ITaskVtbl)->GetStatusDictionaryHandle(TaskHandle) #define ITask_SetExpandStringCallback(TaskHandle, UserPtr, Callback) \ Class_VtblCast(TaskHandle, ITaskVtbl)->SetExpandStringCallback(TaskHandle, UserPtr, Callback) #define ITask_GetExpandStringCallback(TaskHandle, UserPtr, Callback) \ diff --git a/workflowi.h b/workflowi.h index 010163d..24d8b16 100644 --- a/workflowi.h +++ b/workflowi.h @@ -17,7 +17,7 @@ typedef struct IWorkflowVtbl { bool (*FindTaskByName)(echandle WorkflowHandle, const char *Name, echandle *TaskHandle); bool (*GetParentTaskHandle)(echandle WorkflowHandle, echandle TaskHandle, echandle *ParentTaskHandle); - bool (*FindTaskHandler)(echandle WorkflowHandle, char *Type, ITask **Interface); + bool (*FindTaskHandler)(echandle WorkflowHandle, const char *Type, ITask **Interface); bool (*RegisterTaskHandler)(echandle WorkflowHandle, ITask *Interface); bool (*UnregisterTaskHandler)(echandle WorkflowHandle, ITask *Interface); @@ -127,10 +127,10 @@ typedef struct IWorkflowVtbl { Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->SetExpandStringCallback(WorkflowHandle, UserPtr, Callback) #define IWorkflow_GetExpandStringCallback(WorkflowHandle, UserPtr, Callback) \ Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->GetExpandStringCallback(WorkflowHandle, UserPtr, Callback) -#define IWorkflow_GetMacroDictionaryHandle(WorkflowHandle, MacroDictionaryHandle) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->GetMacroDictionaryHandle(WorkflowHandle, MacroDictionaryHandle) -#define IWorkflow_GetDictionaryHandle(WorkflowHandle, DictionaryHandle) \ - Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->GetDictionaryHandle(WorkflowHandle, DictionaryHandle) +#define IWorkflow_GetMacroDictionaryHandle(WorkflowHandle) \ + Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->GetMacroDictionaryHandle(WorkflowHandle) +#define IWorkflow_GetDictionaryHandle(WorkflowHandle) \ + Class_VtblCast(WorkflowHandle, IWorkflowVtbl)->GetDictionaryHandle(WorkflowHandle) #define IWorkflow_RegisterTask(WorkflowHandle, TASK) IWorkflow_RegisterTaskHandler(WorkflowHandle, &TASK##_INTERFACE) #define IWorkflow_UnregisterTask(WorkflowHandle, TASK) \