Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update task, workflow and dictionary interfaces for DIRECT 7. #29

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 65 additions & 82 deletions dictionaryi.h

Large diffs are not rendered by default.

1,491 changes: 704 additions & 787 deletions docs/dictionary.md

Large diffs are not rendered by default.

152 changes: 30 additions & 122 deletions docs/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

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)
- [Task\_IsCompleted](#task_iscompleted)
- [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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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.
Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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"
```

Expand Down Expand Up @@ -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"
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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": {
Expand All @@ -790,11 +748,11 @@ _Task_:
}
```
_Code_:
```c
```
Task_AddErrorFromMap(TaskHandle, "404", "UI_WhoKnows")
```
_Result Equivalent_:
```c
```
Task_AddError(TaskHandle, "UI_NotFound")
```

Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -1063,29 +985,15 @@ 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.

|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

Expand Down
Loading