281 lines
8.9 KiB
HTML
281 lines
8.9 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>Qp0zGetAllSysEnv()--Get All System-Level Environment Variables</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 -->
|
||
|
<!-- Direct1 SCRIPT J converted by B2H R4.1 (346) (CMS) by V2KEA304 -->
|
||
|
<!-- at RCHVMW2 on 17 Feb 1999 at 11:05:09 -->
|
||
|
<!-- This file has undergone html cleanup on 04/29/02 by JET -->
|
||
|
<!-- 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>Qp0zGetAllSysEnv()--Get All System-Level Environment Variables</h2>
|
||
|
|
||
|
<div class="box" style="width: 70%;">
|
||
|
<br>
|
||
|
Syntax
|
||
|
|
||
|
<pre>
|
||
|
#include <qp0z1170.h>
|
||
|
|
||
|
int Qp0zGetAllSysEnv(char <em>*list_buf</em>, int <em>*list_buf_size</em>,
|
||
|
int <em>*ccsid_buf</em>, int <em>*ccsid_buf_size</em>,
|
||
|
void <em>*reserved</em>);
|
||
|
|
||
|
</pre>
|
||
|
|
||
|
Service Program Name: QP0ZSYSE<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
Default Public Authority: *USE<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
Threadsafe: Yes<br>
|
||
|
<!-- iddvc RMBR -->
|
||
|
<br>
|
||
|
</div>
|
||
|
|
||
|
<p>The <strong>Qp0zGetAllSysEnv()</strong> function fills in the <samp>
|
||
|
list_buf</samp> with a list of all the system-level environment variables. The
|
||
|
list consists of multiple null-terminated <samp>name=value</samp> strings
|
||
|
followed by an ending null-terminator. The coded character set identifier
|
||
|
(CCSID) associated with each <samp>name=value</samp> string is returned in the
|
||
|
<samp>ccsid_buf</samp> buffer.</p>
|
||
|
|
||
|
<br>
|
||
|
<h3>Authorities</h3>
|
||
|
|
||
|
<p>None</p>
|
||
|
|
||
|
<br>
|
||
|
<h3>Parameters</h3>
|
||
|
|
||
|
<dl>
|
||
|
<dt><strong><em>list_buf</em></strong></dt>
|
||
|
|
||
|
<dd>(Input/Output) The address of the buffer to receive the null-terminated
|
||
|
<samp>name=value</samp> list.<br>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong><em>list_buf_size</em></strong></dt>
|
||
|
|
||
|
<dd>(Input/Output) A pointer to an integer that contains the information about
|
||
|
the size (in bytes) of the <samp>list_buf</samp> buffer. Before calling
|
||
|
<strong>Qp0zGetAllSysEnv()</strong>, this parameter should be set to the size
|
||
|
of <samp>list_buf</samp>. If the size of this parameter is large enough to
|
||
|
receive the list, then this field will be set to the exact size of the list
|
||
|
upon returning from <strong>Qp0zGetAllSysEnv().</strong> If the size of this
|
||
|
parameter is not large enough to receive the list, then this field will contain
|
||
|
the exact size required and ENOSPC will be the return value. In this case, the
|
||
|
<em>list_buf</em> is not modified.<br>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong><em>ccsid_buf</em></strong></dt>
|
||
|
|
||
|
<dd>(Input/Output) The address of the buffer to receive the CCSIDs of the
|
||
|
environment variables. The order of the CCSIDs returned corresponds to the
|
||
|
order of the variables returned in the <em>list_buf</em><br>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong><em>ccsid_buf_size</em></strong></dt>
|
||
|
|
||
|
<dd>(Input/Output) A pointer to an integer that contains the information about
|
||
|
the size (in bytes) of the <samp>ccsid_buf</samp> buffer. Before calling
|
||
|
<strong>Qp0zGetAllSysEnv()</strong>, this should be set to the size of <samp>
|
||
|
ccsid_buf</samp>. If this size is enough to receive the CCSID list, then this
|
||
|
field will contain the exact size of the CCSIDs received upon returning from
|
||
|
<strong>Qp0zGetAllSysEnv()</strong>. If this size is not enough to receive the
|
||
|
CCSID list, then this field will contain the exact size required and ENOSPC
|
||
|
will be the return value. In this case, the <em>ccsid_buf</em> is not
|
||
|
modified.<br>
|
||
|
</dd>
|
||
|
|
||
|
<dt><strong><em>reserved</em></strong></dt>
|
||
|
|
||
|
<dd>(Input) Reserved for future use. Currently, the only allowed value is
|
||
|
NULL.</dd>
|
||
|
</dl>
|
||
|
|
||
|
<br>
|
||
|
<h3>Return Value</h3>
|
||
|
|
||
|
<table cellpadding="5">
|
||
|
<!-- cols="15 85" -->
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>0</em></td>
|
||
|
<td align="left" valign="top"><strong>Qp0zGetAllSysEnv()</strong> was
|
||
|
successful. The <samp>list_buf</samp> contains the null-terminated system-level
|
||
|
environment variable strings, and the <samp>ccsid_buf</samp> contains the CCSID
|
||
|
of each variable in the same order. The <samp>list_buf_size</samp> contains the
|
||
|
exact size of the environment variable list, and the <samp>
|
||
|
ccsid_buf_size</samp> contains the exact size of the CCSID list.</td>
|
||
|
</tr>
|
||
|
|
||
|
<tr>
|
||
|
<td align="left" valign="top"><em>errval</em></td>
|
||
|
<td align="left" valign="top"><strong>Qp0zGetAllSysEnv()</strong> was not
|
||
|
succesful. <em>errval</em> indicates the error.</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
<br>
|
||
|
<br>
|
||
|
<h3>Error Conditions</h3>
|
||
|
|
||
|
<p>If <strong>Qp0zGetAllSysEnv()</strong> is not successful, <em>errval</em>
|
||
|
indicates one of the following errors.</p>
|
||
|
|
||
|
<dl compact>
|
||
|
<dt><em>[EFAULT]</em></dt>
|
||
|
|
||
|
<dd>
|
||
|
<p>The address used for an argument is not correct.</p>
|
||
|
|
||
|
<p>In attempting to use an argument in a call, the system detected an address
|
||
|
that is not valid.</p>
|
||
|
|
||
|
<p>While attempting to access a parameter passed to this function, the system
|
||
|
detected an address that is not valid.</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>An argument value is not valid, out of range, or NULL.</p>
|
||
|
|
||
|
<p>The value for the <em>reserved</em> parameter was not NULL.</p>
|
||
|
</dd>
|
||
|
|
||
|
<dt><em>[ENOENT]</em></dt>
|
||
|
|
||
|
<dd>
|
||
|
<p>No such path or directory.</p>
|
||
|
|
||
|
<p>The directory or a component of the path name specified does not exist.</p>
|
||
|
|
||
|
<p>A named file or directory does not exist or is an empty string.</p>
|
||
|
|
||
|
<p>There were no system-level environment variables.</p>
|
||
|
</dd>
|
||
|
|
||
|
<dt><em>[ENOSPC]</em></dt>
|
||
|
|
||
|
<dd>
|
||
|
<p>No space available.</p>
|
||
|
|
||
|
<p>The requested operations required additional space on the device and there
|
||
|
is no space left. This could also be caused by exceeding the user profile
|
||
|
storage limit when creating or transferring ownership of an object.</p>
|
||
|
|
||
|
<p>Insufficient space remains to hold the intended file, directory, or
|
||
|
link.</p>
|
||
|
|
||
|
<p>The size of the buffers to receive the list and the CCSIDs was not enough.
|
||
|
The <em>list_buf_size</em> and <em>ccsid_buf_size</em> parameters indicate the
|
||
|
exact size needed for the <em>list_buf</em> <em>ccsid_buf</em>
|
||
|
respectively.</p>
|
||
|
</dd>
|
||
|
|
||
|
<dt><em>[EUNKNOWN]</em></dt>
|
||
|
|
||
|
<dd>
|
||
|
<p>Unknown system state.</p>
|
||
|
|
||
|
<p>The operation failed because of an unknown system state. See any messages in
|
||
|
the job log and correct any errors that are indicated, then retry the
|
||
|
operation.</p>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
<br>
|
||
|
<h3><a name="USAGE_NOTES">Usage Notes</a></h3>
|
||
|
|
||
|
<ol>
|
||
|
<li>No translation is done based on the CCSID. The CCSID is just stored and
|
||
|
retrieved as an integer value associated with each environment variable.</li>
|
||
|
</ol>
|
||
|
|
||
|
<br>
|
||
|
<h3>Related Information</h3>
|
||
|
|
||
|
<ul>
|
||
|
<li>The <<strong>qp0z1170.h</strong>> file (see <a href="unix13.htm">
|
||
|
Header Files for UNIX-Type Functions</a>)</li>
|
||
|
|
||
|
<li><a href="evgetenv.htm">getenv()</a>--Get Value of Environment Variable</li>
|
||
|
|
||
|
<li><a href="evputenv.htm">putenv()</a>--Change or Add Environment
|
||
|
Variable</li>
|
||
|
|
||
|
<li><a href="evdltenv.htm">Qp0zDltEnv()</a>--Delete an Environment Variable<br>
|
||
|
</li>
|
||
|
|
||
|
<li><a href="evdltsev.htm">Qp0zDltSysEnv()</a>--Delete a System-Level
|
||
|
Environment Variable</li>
|
||
|
|
||
|
<li><a href="evgenvxt.htm">Qp0zGetEnv()</a>--Get Value of Environment Variable
|
||
|
(Extended)</li>
|
||
|
|
||
|
<li><a href="evgetsev.htm">Qp0zGetSysEnv()</a>--Get Value of System-Level
|
||
|
Environment Variable</li>
|
||
|
|
||
|
<li><a href="evinenv.htm">Qp0zInitEnv()</a>--Initialize Environment for
|
||
|
Variables</li>
|
||
|
|
||
|
<li><a href="evpenvxt.htm">Qp0zPutEnv()</a>--Change or Add Environment Variable
|
||
|
(Extended)</li>
|
||
|
|
||
|
<li><a href="evputsev.htm">Qp0zPutSysEnv()</a>--Change or Add a System-Level
|
||
|
Environment</li>
|
||
|
</ul>
|
||
|
|
||
|
<br>
|
||
|
<h3>Example</h3>
|
||
|
<p>See <a href="../apiref/aboutapis.htm#codedisclaimer">Code disclaimer information</a>
|
||
|
for information pertaining to code examples.</p>
|
||
|
<ol type="1">
|
||
|
<li>See the example in <a href="evputsev.htm">Qp0zPutSysEnv()</a>--Change or
|
||
|
Add a System-Level Environment.</li>
|
||
|
|
||
|
<li>See the two-part example in <a href="../apiref/apiexsavvar.htm">Saving and
|
||
|
Restoring System-Level Environment Variables</a> in Examples: APIS.</li>
|
||
|
</ol>
|
||
|
|
||
|
<br>
|
||
|
<hr>
|
||
|
API introduced: V4R4
|
||
|
|
||
|
<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>
|
||
|
|