ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/cntltrml.htm

314 lines
8.6 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>Qp0zControlTerminal()--Control a Generic Terminal</title>
<!-- Begin Header Records -->
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<!-- Created by Mike Mundy for V5R1-->
<!-- Edited for tagging 2/2/2001 -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!--Java sync-link-->
<script language="Javascript" src="../rzahg/synch.js" type="text/javascript">
</script>
<a name="Top_Of_Page"></a>
<h2>Qp0zControlTerminal()--Control a Generic Terminal</h2>
<div class="box" style="width: 60%;">
<br>
&nbsp;&nbsp;Syntax
<pre>
&nbsp;#include &lt;qp0ztrml.h&gt;
int Qp0zControlTerminal( unsigned char <em>action</em>, int <em>value</em> );&nbsp;&nbsp;
</pre>
&nbsp;&nbsp;Service Program Name: QP0ZTRMLC<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The <strong>Qp0zControlTerminal()</strong> function allows a program to
control the terminal window to which it is connected. A program can perform the
same actions on the terminal window as an interactive user of the terminal
window. See <a href="gentrml.htm">Generic Terminal Concepts</a> for details
about using a terminal.</p>
<p><strong>Qp0zControlTerminal()</strong> supports the following actions:</p>
<dl>
<dt><strong>QP0Z_TERMINAL_BOTTOM</strong> (0xB6)</dt>
<dd>Display bottom of output area. The bottom of the output area is
displayed.<br>
<br>
</dd>
<dt><strong>QP0Z_TERMINAL_CLCMDLINE</strong> (0xB9)</dt>
<dd>Display CL command line. A pop-up window with a CL command line is
displayed. The user can run a CL command without exiting the terminal
window.<br>
<br>
</dd>
<dt><strong>QP0Z_TERMINAL_CLEAR</strong> (0xB1)</dt>
<dd>Clear output area. The contents of the output area and the command
retrieval buffer are cleared.<br>
<br>
</dd>
<dt><strong>QP0Z_TERMINAL_EXIT</strong> (0x33)</dt>
<dd>Exit terminal window. The terminal window is ended and <a href=
"runtrml.htm">Qp0zRunTerminal()</a> returns 1 (or QP0Z_TERMINAL_F3).<br>
<br>
</dd>
<dt><strong>QP0Z_TERMINAL_LEFT</strong> (0xB7)</dt>
<dd>Shift output area left. The output area is shifted to the left by the
number of columns specified by <em>value</em>. If <em>value</em> is zero, the
output area is shifted left by the number columns currently in the output
area.<br>
<br>
</dd>
<dt><strong>QP0Z_TERMINAL_PAGEDOWN</strong> (0x38)</dt>
<dd>Page down output area. The output area is moved down by the number of rows
specified by <em>value</em>. If <em>value</em> is zero, the output area is
moved down by the number rows currently in the output area (one page).<br>
<br>
</dd>
<dt><strong>QP0Z_TERMINAL_PAGEUP</strong> (0x37)</dt>
<dd>Page up output area. The output area is moved up by the number of rows
specified by <em>value</em>. If <em>value</em> is zero, the output area is
moved up by the number rows currently in the output area (one page).<br>
<br>
</dd>
<dt><strong>QP0Z_TERMINAL_PRINT</strong> (0x36)</dt>
<dd>Print output area. The contents of the output area are printed to a QPRINT
spool file.<br>
<br>
</dd>
<dt><strong>QP0Z_TERMINAL_REFRESH</strong> (0x35)</dt>
<dd>Refresh output area. The contents of the output area are refreshed with any
output that is available.<br>
<br>
</dd>
<dt><strong>QP0Z_TERMINAL_RETRIEVE</strong> (0x39)</dt>
<dd>Retrieve previous command. The last command entered by the user is
retrieved and displayed on the input line.<br>
<br>
</dd>
<dt><strong>QP0Z_TERMINAL_RETURN</strong> (0x3C)</dt>
<dd>Return from terminal window. The terminal window is ended and <a href=
"runtrml.htm">Qp0zRunTerminal()</a> returns 0 (or QP0Z_TERMINAL_F12).<br>
<br>
</dd>
<dt><strong>QP0Z_TERMINAL_RIGHT</strong> (0xB8)</dt>
<dd>Shift output area right. The output area is shifted to the right by the
number of columns specified by <em>value</em>. If <em>value</em> is zero, the
output area is shifted right by the number columns currently in the output
area.<br>
<br>
</dd>
<dt><strong>QP0Z_TERMINAL_TOP</strong> (0xB5)</dt>
<dd>Display top of output area. The top of the output area is displayed.</dd>
</dl>
<br>
<h3>Parameters</h3>
<dl>
<dt><strong><em>action</em></strong></dt>
<dd>(Input)<br>
<p>Action to perform on the terminal window. The valid values are listed
above.</p>
</dd>
<dt><strong><em>value</em></strong></dt>
<dd>(Input)<br>
<p>Value associated with <em>action</em>. For the QP0Z_TERMINAL_LEFT and
QP0Z_TERMINAL_RIGHT actions, the value is the number of columns to shift or
zero for the default number of columns. For the QP0Z_TERMINAL_PAGEDOWN and
QP0Z_TERMINAL_PAGEUP actions, the value is the number of rows to page up or
down or zero for the default number of rows. For all other actions, this
parameter must be zero.</p>
</dd>
</dl>
<br>
<h3>Authorities and Locks</h3>
<p>None.</p>
<br>
<h3>Return Value</h3>
<table width="100%">
<!-- cols="10 90" -->
<tr>
<td align="left" valign="top"><em>0</em></td>
<td align="left" valign="top"><strong>Qp0zControlTerminal()</strong> was successful.</td>
</tr>
<tr>
<td align="left" valign="top"><em>value</em></td>
<td align="left" valign="top"><strong>Qp0zControlTerminal()</strong> was not successful. The value
returned is an errno indicating the failure.</td>
</tr>
</table>
<br>
<br>
<h3>Error Conditions</h3>
<p>If <strong>Qp0zControlTerminal()</strong> is not successful, the return
value usually indicates one of the following errors. Under some conditions, the
return value could indicate an error other than those listed here.</p>
<dl>
<dt><em>[EBADF]</em></dt>
<dd><p>Descriptor not valid.</p>
<p>A file descriptor argument was out of range, referred to a file that was not
open, or a read or write request was made to a file that is not open for that
operation.</p>
</dd>
<dt><em>[EINVAL]</em></dt>
<dd><p>The value specified for the argument is not correct.</p>
<p>A function was passed incorrect argument values or an operation was
attempted on an object and the operation specified is not supported for that
type of object.</p>
<p>Correct the argument in error and try your request again.</p>
</dd>
<dt><em>[EIO]</em></dt>
<dd><p>Input/output error.</p>
<p>A physical I/O error occurred.</p>
<p>See the previous message in the job log. Correct any errors indicated there
and try your operation again.</p>
</dd>
<dt><em>[ENOTTY]</em></dt>
<dd><p>Inappropriate I/O control operation.</p>
</dd>
<dt><em>[EUNKNOWN]</em></dt>
<dd><p>Unknown system state.</p>
<p>The operation failed due to an unknown system state. See any messages in the
job log and correct any errors that may be indicated and then retry the
operation.</p>
</dd>
</dl>
<br>
<h3>Usage Notes</h3>
<ol>
<li>Before calling <strong>Qp0zControlTerminal()</strong>, a program should
check to see if descriptor 0 is connected to a terminal by calling <a href=
"isatrml.htm">Qp0zIsATerminal()</a>.<br>
<br>
</li>
<li>There is no way for the Generic Terminal to prevent multiple programs
calling <strong>Qp0zControlTerminal()</strong> to control the terminal window.
A program must provide appropriate synchronization between calls to <strong>
Qp0zControlTerminal()</strong> to avoid confusing the user of the
terminal.</li>
</ol>
<br>
<h3>Related Information</h3>
<ul>
<li>The &lt;<strong>qp0ztrml.h</strong>&gt; file (see <a href="unix13.htm">
Header Files for UNIX-Type Functions</a>)<br>
<br>
</li>
<li><a href="endtrml.htm">Qp0zEndTerminal()</a>--End a Generic Terminal<br>
<br>
</li>
<li><a href="gettrmlp.htm">Qp0zGetTerminalPid()</a>--Get Process ID for a
Generic Terminal<br>
<br>
</li>
<li><a href="isatrml.htm">Qp0zIsATerminal()</a>--Determine Whether Descriptor
Is Connected to a Generic Terminal<br>
<br>
</li>
<li><a href="runtrml.htm">Qp0zRunTerminal()</a>--Run a Generic Terminal<br>
<br>
</li>
<li><a href="settrmlm.htm">Qp0zSetTerminalMode()</a>--Set Modes for a Generic
Terminal<br>
<br>
</li>
<li><a href="startrml.htm">Qp0zStartTerminal()</a>--Start a Generic
Terminal</li>
</ul>
<hr>
API introduced: V5R1
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> |
<a href="unix.htm">UNIX-Type APIs</a> | <a href="aplist.htm">APIs by
category</a></td>
</tr>
</table></center>
</body>
</html>