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

117 lines
3.2 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>_putshort()--Put Short Byte Quantities</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. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- Unix8 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
<!-- Edited by Kersten Feb 02 -->
<!-- End Header Records -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!-- Java sync-link -->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<a name="Top_Of_Page"></a>
<h2>_putshort()--Put Short Byte Quantities</h2>
<div class="box" style="width: 70%;">
<br>
&nbsp;&nbsp;Syntax<br>
<pre>
#include &lt;sys/types.h&gt;
#include &lt;netinet/in.h&gt;
#include &lt;arpa/nameser.h&gt;
#include &lt;resolv.h&gt;
void _putshort(unsigned short <em>short_integer</em>,
unsigned char *<em>message_pointer</em>)
</pre>
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The <em>_putshort()</em> function is used to put an unsigned short byte
quantity into a byte stream.</p>
<br>
<!-- Please NOTE: DO NOT DELETE THIS SECTION if this API has no authorities and locks. -->
<!-- Instead, use the commented out coding below to indicate NONE. -->
<h3>Authorities and Locks</h3>
<!-- Use this if there are no authorities and locks. -->
<p>None.</p>
<br>
<h3>Parameters</h3>
<dl>
<dt>unsigned short <strong>short_int</strong></dt>
<dd>(Input) The 16-bit integer to be put into the byte stream. <br>
<br>
</dd>
<dt>unsigned char *<strong>message_pointer</strong></dt>
<dd>(Input) The pointer to where the <em>short_integer</em> is to be put.</dd>
</dl>
<br>
<h3>Return Value</h3>
<p><em>_putshort()</em> puts a 16-bit integer into
<em>message_pointer</em>.</p>
<br>
<h3>Usage Notes</h3>
<p>DNS packets have fields that are unsigned short integers (for example,
type, class, and data length). <em>_putshort()</em> is generally used to put
these fields into a DNS packet.</p>
<br>
<h3>Related Information</h3>
<ul>
<li><a href="getl.htm">_getlong()</a>--Get Long Byte Quantities <br>
<br>
</li>
<li><a href="gets.htm">_getshort()</a>--Get Short Byte Quantities <br>
<br>
</li>
<li><a href="putl.htm">_putlong()</a>--Put Long Byte Quantities</li>
</ul>
<br>
<hr>
API introduced: V3R1
<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>