XML_GetFeatureList(): New API function.

This commit is contained in:
Fred L. Drake, Jr. 2002-08-26 17:19:41 +00:00
parent cf8591548a
commit bb761420b6
3 changed files with 41 additions and 1 deletions

View file

@ -116,6 +116,7 @@ Clark Cooper to retain copyright and to distribute it with expat.</p>
<li><a href="#XML_DefaultCurrent">XML_DefaultCurrent</a></li>
<li><a href="#XML_ExpatVersion">XML_ExpatVersion</a></li>
<li><a href="#XML_ExpatVersionInfo">XML_ExpatVersionInfo</a></li>
<li><a href="#XML_GetFeatureList">XML_GetFeatureList</a></li>
</ul>
</li>
</ul>
@ -1652,6 +1653,23 @@ Testing these constants is currently the best way to determine if
particular parts of the Expat API are available.
</div>
<pre class="fcndec" id="XML_GetFeatureList">
const char **
XML_GetFeatureList();
</pre>
<div class="fcndef">
<p>Returns a list of "feature" identifiers that provide details on how
Expat was configured at compile time. Most applications should not
need to worry about this, but this information is otherwise not
available from Expat. This function allows code that does need to
check these features to do so at runtime.</p>
<p>The return value is an array of strings, terminated by NULL,
identifying the feature-test macros Expat was compiled with. Common
features which may be found in this list include
<code>"XML_DTD"</code> and <code>"XML_UNICODE"</code>.
</div>
<hr />
<p><a href="http://validator.w3.org/check/referer"><img
src="valid-xhtml10.png" alt="Valid XHTML 1.0!"

View file

@ -864,6 +864,9 @@ typedef struct {
XMLPARSEAPI(XML_Expat_Version)
XML_ExpatVersionInfo(void);
XMLPARSEAPI(const char **)
XML_GetFeatureList(void);
/* Expat follows the GNU/Linux convention of odd number minor version for
beta/development releases and even number minor version for stable

View file

@ -1584,7 +1584,8 @@ XML_ExpatVersion(void) {
}
XML_Expat_Version
XML_ExpatVersionInfo(void) {
XML_ExpatVersionInfo(void)
{
XML_Expat_Version version;
version.major = XML_MAJOR_VERSION;
@ -1594,6 +1595,24 @@ XML_ExpatVersionInfo(void) {
return version;
}
const char **
XML_GetFeatureList(void)
{
static const char *features[] = {
#ifdef XML_DTD
"XML_DTD",
#endif
#ifdef XML_UNICODE
"XML_UNICODE",
#endif
#ifdef XML_UNICODE_WCHAR_T
"XML_UNICODE_WCHAR_T",
#endif
NULL
};
return features;
}
static
enum XML_Error contentProcessor(XML_Parser parser,
const char *start,