Sophie

Sophie

distrib > Mandriva > 9.0 > i586 > by-pkgid > d67485fb8ce60f8952179bbde3b5d022 > files > 43

libgdal0-devel-1.1.7-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta name="robots" content="noindex">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>cpl_conv.h File Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.2.3-20001105 on Thu Mar 28 09:47:31 2002 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>cpl_conv.h File Reference</h1><code>#include "<a class="el" href="cpl_port_h-source.html">cpl_port.h</a>"</code><br>
<code>#include "<a class="el" href="cpl_vsi_h-source.html">cpl_vsi.h</a>"</code><br>
<code>#include "<a class="el" href="cpl_error_h-source.html">cpl_error.h</a>"</code><br>

<p>
<a href="cpl_conv_h-source.html">Go to the source code of this file.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=2><br><h2>Defines</h2></td></tr>
<tr><td nowrap align=right valign=top><a name="a0" doxytag="cpl_conv.h::CPLFree"></a>
#define&nbsp;</td><td valign=bottom><b>CPLFree</b>&nbsp;&nbsp;&nbsp;VSIFree</td></tr>
<tr><td colspan=2><br><h2>Typedefs</h2></td></tr>
<tr><td nowrap align=right valign=top><a name="a1" doxytag="cpl_conv.h::CPLFileFinder"></a>
typedef const char* (*&nbsp;</td><td valign=bottom><b>CPLFileFinder</b> )(const char *, const char *)</td></tr>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td nowrap align=right valign=top><a name="a2" doxytag="cpl_conv.h::CPLVerifyConfiguration"></a>
CPL_C_START void CPL_DLL&nbsp;</td><td valign=bottom><b>CPLVerifyConfiguration</b> ()</td></tr>
<tr><td nowrap align=right valign=top>void CPL_DLL*&nbsp;</td><td valign=bottom><a class="el" href="cpl_conv_h.html#a3">CPLMalloc</a> ( size_t )</td></tr>
<tr><td nowrap align=right valign=top>void CPL_DLL*&nbsp;</td><td valign=bottom><a class="el" href="cpl_conv_h.html#a4">CPLCalloc</a> ( size_t, size_t )</td></tr>
<tr><td nowrap align=right valign=top>void CPL_DLL*&nbsp;</td><td valign=bottom><a class="el" href="cpl_conv_h.html#a5">CPLRealloc</a> ( void *, size_t )</td></tr>
<tr><td nowrap align=right valign=top>char CPL_DLL*&nbsp;</td><td valign=bottom><a class="el" href="cpl_conv_h.html#a6">CPLStrdup</a> ( const char * )</td></tr>
<tr><td nowrap align=right valign=top>const char CPL_DLL*&nbsp;</td><td valign=bottom><a class="el" href="cpl_conv_h.html#a7">CPLReadLine</a> ( FILE * )</td></tr>
<tr><td nowrap align=right valign=top>void CPL_DLL*&nbsp;</td><td valign=bottom><a class="el" href="cpl_conv_h.html#a8">CPLGetSymbol</a> ( const char *, const char * )</td></tr>
<tr><td nowrap align=right valign=top>char CPL_DLL**&nbsp;</td><td valign=bottom><a class="el" href="cpl_conv_h.html#a9">CPLReadDir</a> ( const char *pszPath )</td></tr>
<tr><td nowrap align=right valign=top>const char CPL_DLL*&nbsp;</td><td valign=bottom><a class="el" href="cpl_conv_h.html#a10">CPLGetPath</a> ( const char * )</td></tr>
<tr><td nowrap align=right valign=top>const char CPL_DLL*&nbsp;</td><td valign=bottom><a class="el" href="cpl_conv_h.html#a11">CPLGetFilename</a> ( const char * )</td></tr>
<tr><td nowrap align=right valign=top>const char CPL_DLL*&nbsp;</td><td valign=bottom><a class="el" href="cpl_conv_h.html#a12">CPLGetBasename</a> ( const char * )</td></tr>
<tr><td nowrap align=right valign=top>const char CPL_DLL*&nbsp;</td><td valign=bottom><a class="el" href="cpl_conv_h.html#a13">CPLGetExtension</a> ( const char * )</td></tr>
<tr><td nowrap align=right valign=top>const char CPL_DLL*&nbsp;</td><td valign=bottom><a class="el" href="cpl_conv_h.html#a14">CPLFormFilename</a> ( const char *pszPath, const char *pszBasename, const char *pszExtension )</td></tr>
<tr><td nowrap align=right valign=top>const char CPL_DLL*&nbsp;</td><td valign=bottom><a class="el" href="cpl_conv_h.html#a15">CPLFormCIFilename</a> ( const char *pszPath, const char *pszBasename, const char *pszExtension )</td></tr>
<tr><td nowrap align=right valign=top>const char CPL_DLL*&nbsp;</td><td valign=bottom><a class="el" href="cpl_conv_h.html#a16">CPLResetExtension</a> ( const char *, const char * )</td></tr>
<tr><td nowrap align=right valign=top><a name="a17" doxytag="cpl_conv.h::CPLFindFile"></a>
const char CPL_DLL*&nbsp;</td><td valign=bottom><b>CPLFindFile</b> (const char *pszClass, const char *pszBasename)</td></tr>
<tr><td nowrap align=right valign=top><a name="a18" doxytag="cpl_conv.h::CPLDefaultFindFile"></a>
const char CPL_DLL*&nbsp;</td><td valign=bottom><b>CPLDefaultFindFile</b> (const char *pszClass, const char *pszBasename)</td></tr>
<tr><td nowrap align=right valign=top><a name="a19" doxytag="cpl_conv.h::CPLPushFileFinder"></a>
void CPL_DLL&nbsp;</td><td valign=bottom><b>CPLPushFileFinder</b> ( CPLFileFinder pfnFinder )</td></tr>
<tr><td nowrap align=right valign=top><a name="a20" doxytag="cpl_conv.h::CPLPopFileFinder"></a>
CPLFileFinder CPL_DLL&nbsp;</td><td valign=bottom><b>CPLPopFileFinder</b> ()</td></tr>
<tr><td nowrap align=right valign=top><a name="a21" doxytag="cpl_conv.h::CPLPushFinderLocation"></a>
void CPL_DLL&nbsp;</td><td valign=bottom><b>CPLPushFinderLocation</b> ( const char * )</td></tr>
<tr><td nowrap align=right valign=top><a name="a22" doxytag="cpl_conv.h::CPLPopFinderLocation"></a>
void CPL_DLL&nbsp;</td><td valign=bottom><b>CPLPopFinderLocation</b> ()</td></tr>
<tr><td nowrap align=right valign=top><a name="a23" doxytag="cpl_conv.h::CPLStat"></a>
int CPL_DLL&nbsp;</td><td valign=bottom><b>CPLStat</b> ( const char *, VSIStatBuf * )</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>

<p>
Various convenience functions for CPL.
<p>
<hr><h2>Function Documentation</h2>
<a name="a4" doxytag="cpl_conv.h::CPLCalloc"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
void CPL_DLL* CPLCalloc (
          </b></td>
          <td valign="bottom"><b>
size_t <em>nCount</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
size_t <em>nSize</em>&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Safe version of calloc().
<p>
This function is like the C library calloc(), but raises a CE_Fatal error with <a class="el" href="cpl_error_h.html#a17">CPLError</a>() if it fails to allocate the desired memory. It should be used for small memory allocations that are unlikely to fail and for which the application is unwilling to test for out of memory conditions. It uses <a class="el" href="cpl_vsi_h.html">VSICalloc</a>() to get the memory, so any hooking of <a class="el" href="cpl_vsi_h.html">VSICalloc</a>() will apply to <a class="el" href="cpl_conv_h.html#a4">CPLCalloc</a>() as well. <a class="el" href="cpl_conv_h.html">CPLFree</a>() or <a class="el" href="cpl_vsi_h.html">VSIFree</a>() can be used free memory allocated by <a class="el" href="cpl_conv_h.html#a4">CPLCalloc</a>().<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>nCount</em>
&nbsp;</td><td>
 number of objects to allocate. </td></tr>
<tr><td valign=top><em>nSize</em>
&nbsp;</td><td>
 size (in bytes) of object to allocate. </td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 pointer to newly allocated memory, only NULL if nSize * nCount is NULL. </dl>    </td>
  </tr>
</table>
<a name="a15" doxytag="cpl_conv.h::CPLFormCIFilename"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
const char * CPLFormCIFilename (
          </b></td>
          <td valign="bottom"><b>
const char * <em>pszPath</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
const char * <em>pszBasename</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
const char * <em>pszExtension</em>&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Case insensitive file searching, returing full path.
<p>
This function tries to return the path to a file regardless of whether the file exactly matches the basename, and extension case, or is all upper case, or all lower case. The path is treated as case  sensitive. This function is equivelent to <a class="el" href="cpl_conv_h.html#a14">CPLFormFilename</a>() on  case insensitive file systems (like Windows).<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pszPath</em>
&nbsp;</td><td>
 directory path to the directory containing the file. This may be relative or absolute, and may have a trailing path separator or not. May be NULL.</td></tr>
<tr><td valign=top><em>pszBasename</em>
&nbsp;</td><td>
 file basename. May optionally have path and/or extension. May not be NULL.</td></tr>
<tr><td valign=top><em>pszExtension</em>
&nbsp;</td><td>
 file extension, optionally including the period. May be NULL.
<p>
</td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 a fully formed filename in an internal static string. Do not modify or free the returned string. The string may be destroyed by the next CPL call. </dl>    </td>
  </tr>
</table>
<a name="a14" doxytag="cpl_conv.h::CPLFormFilename"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
const char * CPLFormFilename (
          </b></td>
          <td valign="bottom"><b>
const char * <em>pszPath</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
const char * <em>pszBasename</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
const char * <em>pszExtension</em>&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Build a full file path from a passed path, file basename and extension.
<p>
The path, and extension are optional. The basename may in fact contain an extension if desired.
<p>
<pre>
 CPLFormFilename("abc/xyz","def", ".dat" ) == "abc/xyz/def.dat"
 CPLFormFilename(NULL,"def", NULL ) == "def"
 CPLFormFilename(NULL,"abc/def.dat", NULL ) == "abc/def.dat"
 CPLFormFilename("/abc/xyz/","def.dat", NULL ) == "/abc/xyz/def.dat"
 </pre><dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pszPath</em>
&nbsp;</td><td>
 directory path to the directory containing the file. This may be relative or absolute, and may have a trailing path separator or not. May be NULL.</td></tr>
<tr><td valign=top><em>pszBasename</em>
&nbsp;</td><td>
 file basename. May optionally have path and/or extension. May not be NULL.</td></tr>
<tr><td valign=top><em>pszExtension</em>
&nbsp;</td><td>
 file extension, optionally including the period. May be NULL.
<p>
</td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 a fully formed filename in an internal static string. Do not modify or free the returned string. The string may be destroyed by the next CPL call. </dl>    </td>
  </tr>
</table>
<a name="a12" doxytag="cpl_conv.h::CPLGetBasename"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
const char * CPLGetBasename (
          </b></td>
          <td valign="bottom"><b>
const char * <em>pszFullFilename</em>&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Extract basename (non-directory, non-extension) portion of filename.
<p>
Returns a string containing the file basename portion of the passed name. If there is no basename (passed value ends in trailing directory separator, or filename starts with a dot) an empty string is returned.
<p>
<pre>
 CPLGetBasename( "abc/def.xyz" ) == "def"
 CPLGetBasename( "abc/def" ) == "def"
 CPLGetBasename( "abc/def/" ) == ""
 </pre><dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pszFullFilename</em>
&nbsp;</td><td>
 the full filename potentially including a path.
<p>
</td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 just the non-directory, non-extension portion of the path in an internal string which must not be freed. The string may be destroyed by the next CPL filename handling call. </dl>    </td>
  </tr>
</table>
<a name="a13" doxytag="cpl_conv.h::CPLGetExtension"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
const char * CPLGetExtension (
          </b></td>
          <td valign="bottom"><b>
const char * <em>pszFullFilename</em>&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Extract filename extension from full filename.
<p>
Returns a string containing the extention portion of the passed name. If there is no extension (the filename has no dot) an empty string is returned. The returned extension will not include the period.
<p>
<pre>
 CPLGetExtension( "abc/def.xyz" ) == "xyz"
 CPLGetExtension( "abc/def" ) == ""
 </pre><dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pszFullFilename</em>
&nbsp;</td><td>
 the full filename potentially including a path.
<p>
</td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 just the extension portion of the path in an internal string which must not be freed. The string may be destroyed by the next CPL filename handling call. </dl>    </td>
  </tr>
</table>
<a name="a11" doxytag="cpl_conv.h::CPLGetFilename"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
const char * CPLGetFilename (
          </b></td>
          <td valign="bottom"><b>
const char * <em>pszFullFilename</em>&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Extract non-directory portion of filename.
<p>
Returns a string containing the bare filename portion of the passed filename. If there is no filename (passed value ends in trailing directory separator) an empty string is returned.
<p>
<pre>
 CPLGetFilename( "abc/def.xyz" ) == "def.xyz"
 CPLGetFilename( "/abc/def/" ) == ""
 CPLGetFilename( "abc/def" ) == "def"
 </pre><dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pszFullFilename</em>
&nbsp;</td><td>
 the full filename potentially including a path.
<p>
</td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 just the non-directory portion of the path in an internal string which must not be freed. The string may be destroyed by the next CPL filename handling call. </dl>    </td>
  </tr>
</table>
<a name="a10" doxytag="cpl_conv.h::CPLGetPath"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
const char * CPLGetPath (
          </b></td>
          <td valign="bottom"><b>
const char * <em>pszFilename</em>&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Extract directory path portion of filename.
<p>
Returns a string containing the directory path portion of the passed filename. If there is no path in the passed filename an empty string will be returned (not NULL).
<p>
<pre>
 CPLGetPath( "abc/def.xyz" ) == "abc"
 CPLGetPath( "/abc/def/" ) == "abc/def"
 CPLGetPath( "/" ) == "/"
 CPLGetPath( "/abc/def" ) == "/abc"
 </pre><dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pszFilename</em>
&nbsp;</td><td>
 the filename potentially including a path.
<p>
</td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 Path in an internal string which must not be freed. The string may be destroyed by the next CPL filename handling call. The returned will generally not contain a trailing path separator. </dl>    </td>
  </tr>
</table>
<a name="a8" doxytag="cpl_conv.h::CPLGetSymbol"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
void * CPLGetSymbol (
          </b></td>
          <td valign="bottom"><b>
const char * <em>pszLibrary</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
const char * <em>pszSymbolName</em>&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Fetch a function pointer from a shared library / DLL.
<p>
This function is meant to abstract access to shared libraries and DLLs and performs functions similar to dlopen()/dlsym() on Unix and LoadLibrary() / GetProcAddress() on Windows.
<p>
If no support for loading entry points from a shared library is available this function will always return NULL. Rules on when this function issues a <a class="el" href="cpl_error_h.html#a17">CPLError</a>() or not are not currently well defined, and will have to be resolved in the future.
<p>
Currently <a class="el" href="cpl_conv_h.html#a8">CPLGetSymbol</a>() doesn't try to: <ul>
 <li> prevent the reference count on the library from going up for every request, or given any opportunity to unload  the library.  <li> Attempt to look for the library in non-standard  locations.  <li> Attempt to try variations on the symbol name, like  pre-prending or post-pending an underscore. </ul>

<p>
Some of these issues may be worked on in the future.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pszLibrary</em>
&nbsp;</td><td>
 the name of the shared library or DLL containing the function. May contain path to file. If not system supplies search paths will be used. </td></tr>
<tr><td valign=top><em>pszSymbolName</em>
&nbsp;</td><td>
 the name of the function to fetch a pointer to. </td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 A pointer to the function if found, or NULL if the function isn't found, or the shared library can't be loaded. </dl>    </td>
  </tr>
</table>
<a name="a3" doxytag="cpl_conv.h::CPLMalloc"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
void CPL_DLL* CPLMalloc (
          </b></td>
          <td valign="bottom"><b>
size_t <em>nSize</em>&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Safe version of malloc().
<p>
This function is like the C library malloc(), but raises a CE_Fatal error with <a class="el" href="cpl_error_h.html#a17">CPLError</a>() if it fails to allocate the desired memory. It should be used for small memory allocations that are unlikely to fail and for which the application is unwilling to test for out of memory conditions. It uses <a class="el" href="cpl_vsi_h.html">VSIMalloc</a>() to get the memory, so any hooking of <a class="el" href="cpl_vsi_h.html">VSIMalloc</a>() will apply to <a class="el" href="cpl_conv_h.html#a3">CPLMalloc</a>() as well. <a class="el" href="cpl_conv_h.html">CPLFree</a>() or <a class="el" href="cpl_vsi_h.html">VSIFree</a>() can be used free memory allocated by <a class="el" href="cpl_conv_h.html#a3">CPLMalloc</a>().<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>nSize</em>
&nbsp;</td><td>
 size (in bytes) of memory block to allocate. </td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 pointer to newly allocated memory, only NULL if nSize is zero. </dl>    </td>
  </tr>
</table>
<a name="a9" doxytag="cpl_conv.h::CPLReadDir"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
char ** CPLReadDir (
          </b></td>
          <td valign="bottom"><b>
const char * <em>pszPath</em>&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Read names in a directory.
<p>
This function abstracts access to directory contains. It returns a list of strings containing the names of files, and directories in this directory. The resulting string list becomes the responsibility of the application and should be freed with CSLDestroy() when no longer needed.
<p>
Note that no error is issued via <a class="el" href="cpl_error_h.html#a17">CPLError</a>() if the directory path is invalid, though NULL is returned.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pszPath</em>
&nbsp;</td><td>
 the relative, or absolute path of a directory to read. </td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 The list of entries in the directory, or NULL if the directory doesn't exist. </dl>    </td>
  </tr>
</table>
<a name="a7" doxytag="cpl_conv.h::CPLReadLine"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
const char CPL_DLL* CPLReadLine (
          </b></td>
          <td valign="bottom"><b>
FILE * <em>fp</em>&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Simplified line reading from text file.
<p>
Read a line of text from the given file handle, taking care to capture CR and/or LF and strip off ... equivelent of DKReadLine(). Pointer to an internal buffer is returned. The application shouldn't free it, or depend on it's value past the next call to <a class="el" href="cpl_conv_h.html#a7">CPLReadLine</a>().
<p>
Note that <a class="el" href="cpl_conv_h.html#a7">CPLReadLine</a>() uses <a class="el" href="cpl_vsi_h.html">VSIFGets</a>(), so any hooking of VSI file services should apply to <a class="el" href="cpl_conv_h.html#a7">CPLReadLine</a>() as well.
<p>
<a class="el" href="cpl_conv_h.html#a7">CPLReadLine</a>() maintains an internal buffer, which will appear as a  single block memory leak in some circumstances. <a class="el" href="cpl_conv_h.html#a7">CPLReadLine</a>() may  be called with a NULL FILE * at any time to free this working buffer.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>fp</em>
&nbsp;</td><td>
 file pointer opened with <a class="el" href="cpl_vsi_h.html">VSIFOpen</a>(). </td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 pointer to an internal buffer containing a line of text read from the file or NULL if the end of file was encountered. </dl>    </td>
  </tr>
</table>
<a name="a5" doxytag="cpl_conv.h::CPLRealloc"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
void CPL_DLL* CPLRealloc (
          </b></td>
          <td valign="bottom"><b>
void * <em>pData</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
size_t <em>nNewSize</em>&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Safe version of realloc().
<p>
This function is like the C library realloc(), but raises a CE_Fatal error with <a class="el" href="cpl_error_h.html#a17">CPLError</a>() if it fails to allocate the desired memory. It should be used for small memory allocations that are unlikely to fail and for which the application is unwilling to test for out of memory conditions. It uses <a class="el" href="cpl_vsi_h.html">VSIRealloc</a>() to get the memory, so any hooking of <a class="el" href="cpl_vsi_h.html">VSIRealloc</a>() will apply to <a class="el" href="cpl_conv_h.html#a5">CPLRealloc</a>() as well. <a class="el" href="cpl_conv_h.html">CPLFree</a>() or <a class="el" href="cpl_vsi_h.html">VSIFree</a>() can be used free memory allocated by <a class="el" href="cpl_conv_h.html#a5">CPLRealloc</a>().
<p>
It is also safe to pass NULL in as the existing memory block for <a class="el" href="cpl_conv_h.html#a5">CPLRealloc</a>(), in which case it uses <a class="el" href="cpl_vsi_h.html">VSIMalloc</a>() to allocate a new block.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pData</em>
&nbsp;</td><td>
 existing memory block which should be copied to the new block. </td></tr>
<tr><td valign=top><em>nNewSize</em>
&nbsp;</td><td>
 new size (in bytes) of memory block to allocate. </td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 pointer to allocated memory, only NULL if nNewSize is zero. </dl>    </td>
  </tr>
</table>
<a name="a16" doxytag="cpl_conv.h::CPLResetExtension"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
const char * CPLResetExtension (
          </b></td>
          <td valign="bottom"><b>
const char * <em>pszPath</em>, 
          </b></td>
        </tr>
        <tr>
          <td></td>
          <td><b>
const char * <em>pszExt</em>&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Replace the extension with the provided one.<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pszPath</em>
&nbsp;</td><td>
 the input path, this string is not altered. </td></tr>
<tr><td valign=top><em>pszExtension</em>
&nbsp;</td><td>
 the new extension to apply to the given path.
<p>
</td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 an altered filename with the new extension. Do not modify or free the returned string. The string may be destroyed by the next CPL call. </dl>    </td>
  </tr>
</table>
<a name="a6" doxytag="cpl_conv.h::CPLStrdup"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td nowrap valign="top"><b> 
char CPL_DLL* CPLStrdup (
          </b></td>
          <td valign="bottom"><b>
const char * <em>pszString</em>&nbsp;)
          </b></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Safe version of strdup() function.
<p>
This function is similar to the C library strdup() function, but if the memory allocation fails it will issue a CE_Fatal error with <a class="el" href="cpl_error_h.html#a17">CPLError</a>() instead of returning NULL. It uses <a class="el" href="cpl_vsi_h.html">VSIStrdup</a>(), so any hooking of that function will apply to <a class="el" href="cpl_conv_h.html#a6">CPLStrdup</a>() as well. Memory allocated with <a class="el" href="cpl_conv_h.html#a6">CPLStrdup</a>() can be freed with <a class="el" href="cpl_conv_h.html">CPLFree</a>() or <a class="el" href="cpl_vsi_h.html">VSIFree</a>().
<p>
It is also safe to pass a NULL string into <a class="el" href="cpl_conv_h.html#a6">CPLStrdup</a>(). <a class="el" href="cpl_conv_h.html#a6">CPLStrdup</a>() will allocate and return a zero length string (as opposed to a NULL string).<dl compact><dt>
<b>Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>pszString</em>
&nbsp;</td><td>
 input string to be duplicated. May be NULL. </td></tr>
</table>
</dl><dl compact><dt>
<b>Returns: </b><dd>
 pointer to a newly allocated copy of the string. Free with <a class="el" href="cpl_conv_h.html">CPLFree</a>() or <a class="el" href="cpl_vsi_h.html">VSIFree</a>(). </dl>    </td>
  </tr>
</table>
<hr><address><small>Generated at Thu Mar 28 09:47:31 2002 for GDAL by
<a href="http://www.stack.nl/~dimitri/doxygen/index.html">
<img src="doxygen.gif" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.3-20001105 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>,
 &copy;&nbsp;1997-2000</small></address>
</body>
</html>