Thanks, one last question in this context.

On 29.01.2019 21:07, Rick McGuire wrote:
> On Tue, Jan 29, 2019 at 1:18 PM Rony G Flatscher <rony.flatsc...@wu.ac.at
> <mailto:rony.flatsc...@wu.ac.at>> wrote:
>
>     Looked thru the code, a few quick questions:
>
>     If a command handler that has no redirection, would the last argument 
> ioctl be NULL?
>
> No, if the command handler is registered as a redirecting handler, then it 
> will always be passed
> an IOContext. You can then query the context to see if there has been any 
> redirection requested
> and what types.

There is a new IsRedirectionRequested() function listed and documented as:

    8.17.100. *NEW* IsRedirectionRequested

    This API is available in context I/O Redirector since ooRexx 5.0.

    logical_t flag;
    // Method Syntax Form(s)
    flag = context->IsRedirectionRequested();

    Tests whether for the current command any redirection was requested using 
the WITH subkeyword of
    an ADDRESS instruction.

    Arguments: None.

    Returns: 1 if any redirection was requested, 0 otherwise.

    See also methods *NEW* AreOutputAndErrorSameTarget, *NEW* 
IsErrorRedirected, *NEW*
    IsInputRedirected, *NEW* IsOutputRedirected, *NEW* ReadInput, *NEW* 
ReadInputBuffer, *NEW*
    WriteError, *NEW* WriteErrorBuffer, *NEW* WriteOutput, and *NEW* 
WriteOutputBuffer.


The function "AddCommandEnvironment(name,handler,type)" has a "type" argument 
that may be one of
two: DIRECT_COMMAND_ENVIRONMENT and REDIRECTING_COMMAND_ENVIRONMENT.

Question:

    What is exactly the difference between the two?
    E.g. the REDIRECTING_COMMAND_ENVIRONMENT must use the "ReadInput[Buffer]()" 
and the
    "Write{Error|Output}[Buffer]()" functions, whereas the 
"DIRECT_COMMAND_ENVIRONMENT" must use
    .input for reading, .output and .error for writing instead?

Question:

    Can "IsRedirectionRequested()" be issued for both handler types?

    And if so, in the case of a DIRECT_COMMAND_ENVIRONMENT would then the 
functions
    "AreOutputAndErrorSameTarget()", "IsErrorRedirected()", 
"IsInputRedirected()",
    "IsOutputRedirected()" be available as well? If so, how about the 
"Write[*]()" functions?

---rony



_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to