diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-3C2E0C1A-DC7A-55F7-8005-39CEE71CD0A0.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-3C2E0C1A-DC7A-55F7-8005-39CEE71CD0A0.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,58 @@ + + + + + +Emulating +stdin/stdout/stderr in STDLIB +

This section briefly describes the process of emulating in STDLIB.

+
Simple Mode - CCLocalSystemInterface

The following +are the steps to emulate in simple mode:

    +
  1. Create a single CTtyDesc object +per thread and an instance of the basic console object.

  2. +
  3. Attach the CTtyDesc object +to stdin, stdout and stderr.

  4. +
  5. Pass the Requests made +on stdin, stdout and stderr to CTtyDesc.

  6. +

There is a separate console per thread. Therefore, output is spread +over a number of different consoles.

+
Complex Mode - CProcessSystemInterface

The following +are the steps to emulate in complex mode:

    +
  1. Start the POSIX server +in the crt0 glue code.

  2. +
  3. Create either a single +instance of CW32StreamDesc or CReDirDesc in +the POSIX server.

  4. +
  5. Attach it to stdin, stdout and stderr, +which is used by all threads.

    Requests made on stdin, stdout and stderr are +passed to the attached descriptor object.

  6. +
  7. Use CW32StreamDesc for +the emulator only if the RWin32Stream server was started +in the crt0 glue code.

    If CW32StreamDesc cannot +be used or code is compiled for hardware, then useCRedirDesc instead.

  8. +
  9. CReDirDesc connects +and passes the request to a redirection server. If connection fails the output +to stdout and stderr is lost. Nothing is +read from stdin.

  10. +
  11. The client application +(for example, Java RT or the Test application) starts the redirection server. +The client also provides an implementation of CStreamFactoryBase2. +This implementation deals with standard I/O data in a customised way.

  12. +

Stdin/stdout on emulator in complex mode

A text EXE +running on the emulator can either use the wcrt0.lib or wwcrt0.lib crt0 +libraries. These automatically start the RWin32Stream server +to redirect stdin, stdout and stderr to +the Win32 console.

Stdin/stdout on hardware in complex mode

A +test EXE running on target hardware has no default console. The test application +requires application/client specific C++ code to be written to create a new +thread and call CRedirServer2::NewL() to start the redirection +server along with client specific derived classes to plumb the I/O to wherever +it is required. The POSIX server will then connect to this server when stdXXX +streams are used.

+
\ No newline at end of file