modules/portlib/src/main/native/port/windows/hytty.c File Reference


Detailed Description

TTY output.

All VM output goes to stderr by default. These routines provide the helpers for such output.

#include <windows.h>
#include <stdio.h>
#include "hyport.h"
#include "portpriv.h"
#include "hyportpg.h"

Functions

I_32 VMCALL hytty_startup (struct HyPortLibrary *portLibrary)
 PortLibrary startup.
void VMCALL hytty_shutdown (struct HyPortLibrary *portLibrary)
 PortLibrary shutdown.
void VMCALL hytty_printf (struct HyPortLibrary *portLibrary, const char *format,...)
 Write characters to stderr.
IDATA VMCALL hytty_get_chars (struct HyPortLibrary *portLibrary, char *s, UDATA length)
 Read characters from stdin into buffer.
void VMCALL hytty_err_printf (struct HyPortLibrary *portLibrary, const char *format,...)
 Output message to stderr.
IDATA VMCALL hytty_available (struct HyPortLibrary *portLibrary)
 Determine the number of characters remaining to be read from stdin.
void VMCALL hytty_vprintf (struct HyPortLibrary *portLibrary, const char *format, va_list args)
 Output message to stderr.
void VMCALL hytty_err_vprintf (struct HyPortLibrary *portLibrary, const char *format, va_list args)
 Output message to stderr.


Function Documentation

IDATA VMCALL hytty_available ( struct HyPortLibrary portLibrary  ) 

Determine the number of characters remaining to be read from stdin.

Parameters:
[in] portLibrary The port library.
Returns:
number of characters remaining to be read.

void VMCALL hytty_err_printf ( struct HyPortLibrary portLibrary,
const char *  format,
  ... 
)

Output message to stderr.

Parameters:
[in] portLibrary The port library.
[in] format The format String.
[in] ... argument list.
Deprecated:
All output goes to stderr, use hytty_printf()

void VMCALL hytty_err_vprintf ( struct HyPortLibrary portLibrary,
const char *  format,
va_list  args 
)

Output message to stderr.

Parameters:
[in] portLibrary The port library.
[in] format The format String.
[in] args Variable argument list.
Deprecated:
All output goes to stderr, use hytty_vprintf()

IDATA VMCALL hytty_get_chars ( struct HyPortLibrary portLibrary,
char *  s,
UDATA  length 
)

Read characters from stdin into buffer.

Parameters:
[in] portLibrary The port library.
[out] s Buffer.
[in] length Size of buffer (s).
Returns:
The number of characters read, -1 on error.

void VMCALL hytty_printf ( struct HyPortLibrary portLibrary,
const char *  format,
  ... 
)

Write characters to stderr.

Parameters:
[in] portLibrary The port library.
[in] format The format string to be output.
[in] ... arguments for format.
Note:
Use hyfile_printf for stdout output.

void VMCALL hytty_shutdown ( struct HyPortLibrary portLibrary  ) 

PortLibrary shutdown.

This function is called during shutdown of the portLibrary. Any resources that were created by hytty_startup should be destroyed here.

Parameters:
[in] portLibrary The port library.
Note:
Most implementations will be empty.

I_32 VMCALL hytty_startup ( struct HyPortLibrary portLibrary  ) 

PortLibrary startup.

This function is called during startup of the portLibrary. Any resources that are required for the TTY library operations may be created here. All resources created here should be destroyed in hytty_shutdown.

Parameters:
[in] portLibrary The port library.
Returns:
0 on success, negative error code on failure. Error code values returned are
  • HYPORT_ERROR_STARTUP_TTY
  • HYPORT_ERROR_STARTUP_TTY_HANDLE
  • HYPORT_ERROR_STARTUP_TTY_CONSOLE
Note:
Most implementations will simply return success.

void VMCALL hytty_vprintf ( struct HyPortLibrary portLibrary,
const char *  format,
va_list  args 
)

Output message to stderr.

Parameters:
[in] portLibrary The port library.
[in] format The format String.
[in] args Variable argument list.
Note:
Use hyfile_vprintf for stdout output.


Genereated on Tue Dec 9 14:12:59 2008 by Doxygen.

(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.