Files
oldlinux-files/study/Ref-docs/POSIX/susv3/basedefs/glob.h.html
2024-02-19 00:25:23 -05:00

170 lines
5.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link type="text/css" rel="stylesheet" href="style.css"><!-- Generated by The Open Group's rhtm tool v1.2.1 -->
<!-- Copyright (c) 2001 The Open Group, All Rights Reserved -->
<title>&lt;glob.h&gt;</title>
</head>
<body bgcolor="white">
<script type="text/javascript" language="JavaScript" src="../jscript/codes.js">
</script>
<basefont size="3"> <a name="&lt;glob.h&gt;"></a> <a name="tag_13_17"></a><!-- &lt;glob.h&gt; -->
<!--header start-->
<center><font size="2">The Open Group Base Specifications Issue 6<br>
IEEE Std 1003.1-2001<br>
Copyright &copy; 2001 The IEEE and The Open Group, All Rights reserved.</font></center>
<!--header end-->
<hr size="2" noshade>
<h4><a name="tag_13_17_01"></a>NAME</h4>
<blockquote>glob.h - pathname pattern-matching types</blockquote>
<h4><a name="tag_13_17_02"></a>SYNOPSIS</h4>
<blockquote class="synopsis">
<p><tt>#include &lt;glob.h&gt;</tt></p>
</blockquote>
<h4><a name="tag_13_17_03"></a>DESCRIPTION</h4>
<blockquote>
<p>The <i>&lt;glob.h&gt;</i> header shall define the structures and symbolic constants used by the <a href=
"../functions/glob.html"><i>glob</i>()</a> function.</p>
<p>The structure type <b>glob_t</b> shall contain at least the following members:</p>
<pre>
<tt>size_t gl_pathc</tt> Count of paths matched by <i>pattern.</i> <tt>
char **gl_pathv</tt> Pointer to a list of matched pathnames. <tt>
size_t gl_offs </tt> Slots to reserve at the beginning of <i>gl_pathv.</i> <tt>
</tt>
</pre>
<p>The following constants shall be provided as values for the <i>flags</i> argument:</p>
<dl compact>
<dt>GLOB_APPEND</dt>
<dd>Append generated pathnames to those previously obtained.</dd>
<dt>GLOB_DOOFFS</dt>
<dd>Specify how many null pointers to add to the beginning of <i>gl_pathv</i>.</dd>
<dt>GLOB_ERR</dt>
<dd>Cause <a href="../functions/glob.html"><i>glob</i>()</a> to return on error.</dd>
<dt>GLOB_MARK</dt>
<dd>Each pathname that is a directory that matches <i>pattern</i> has a slash appended.</dd>
<dt>GLOB_NOCHECK</dt>
<dd>If <i>pattern</i> does not match any pathname, then return a list consisting of only <i>pattern</i>.</dd>
<dt>GLOB_NOESCAPE</dt>
<dd>Disable backslash escaping.</dd>
<dt>GLOB_NOSORT</dt>
<dd>Do not sort the pathnames returned.</dd>
</dl>
<p>The following constants shall be defined as error return values:</p>
<dl compact>
<dt>GLOB_ABORTED</dt>
<dd>The scan was stopped because GLOB_ERR was set or (*<i>errfunc</i>)() returned non-zero.</dd>
<dt>GLOB_NOMATCH</dt>
<dd>The pattern does not match any existing pathname, and GLOB_NOCHECK was not set in <i>flags</i>.</dd>
<dt>GLOB_NOSPACE</dt>
<dd>An attempt to allocate memory failed.</dd>
<dt>GLOB_NOSYS</dt>
<dd><sup>[<a href="javascript:open_code('OB XSI')">OB XSI</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]"
border="0"> Reserved. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></dd>
</dl>
<p>The following shall be declared as functions and may also be defined as macros. Function prototypes shall be provided.</p>
<pre>
<tt>int glob(const char *restrict, int, int (*restrict)(const char *, int),
glob_t *restrict);
void globfree (glob_t *);
</tt>
</pre>
<p>The implementation may define additional macros or constants using names beginning with GLOB_.</p>
</blockquote>
<hr>
<div class="box"><em>The following sections are informative.</em></div>
<h4><a name="tag_13_17_04"></a>APPLICATION USAGE</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_13_17_05"></a>RATIONALE</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_13_17_06"></a>FUTURE DIRECTIONS</h4>
<blockquote>
<p>None.</p>
</blockquote>
<h4><a name="tag_13_17_07"></a>SEE ALSO</h4>
<blockquote>
<p>The System Interfaces volume of IEEE&nbsp;Std&nbsp;1003.1-2001, <a href="../functions/glob.html"><i>glob</i>()</a>, the Shell
and Utilities volume of IEEE&nbsp;Std&nbsp;1003.1-2001</p>
</blockquote>
<h4><a name="tag_13_17_08"></a>CHANGE HISTORY</h4>
<blockquote>
<p>First released in Issue 4. Derived from the ISO&nbsp;POSIX-2 standard.</p>
</blockquote>
<h4><a name="tag_13_17_09"></a>Issue 6</h4>
<blockquote>
<p>The <b>restrict</b> keyword is added to the prototype for <a href="../functions/glob.html"><i>glob</i>()</a>.</p>
<p>The constant GLOB_NOSYS is marked obsolescent.</p>
</blockquote>
<div class="box"><em>End of informative text.</em></div>
<hr>
<hr size="2" noshade>
<center><font size="2"><!--footer start-->
UNIX &reg; is a registered Trademark of The Open Group.<br>
POSIX &reg; is a registered Trademark of The IEEE.<br>
[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href=
"../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>
]</font></center>
<!--footer end-->
<hr size="2" noshade>
</body>
</html>