eccodes/html/group__grib__handle.html

626 lines
36 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">
<title>grib_api: The grib_handle</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
</ul>
</div>
<h1>The grib_handle</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Typedefs</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef struct <br>
<a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef struct <br>
<a class="el" href="group__grib__handle.html#g569cc40caa2fa0c4e0e22f9a0ecf25f7">grib_multi_handle</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grib__handle.html#g569cc40caa2fa0c4e0e22f9a0ecf25f7">grib_multi_handle</a></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grib__handle.html#gc7f5cb6af67fd0a42bec5376d5b54682">grib_count_in_file</a> (<a class="el" href="grib__api_8h.html#8e7f259b6dec023add23b2a5ddd93bad">grib_context</a> *c, FILE *f, int *n)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Counts the messages contained in a file resource. <a href="#gc7f5cb6af67fd0a42bec5376d5b54682"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grib__handle.html#g5e24f8499aa7e4178ccc25a5de3145c5">grib_handle_new_from_file</a> (<a class="el" href="grib__api_8h.html#8e7f259b6dec023add23b2a5ddd93bad">grib_context</a> *c, FILE *f, int *error)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a handle from a file resource. <a href="#g5e24f8499aa7e4178ccc25a5de3145c5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grib__handle.html#gcf9ab4896fac2fbbe30a33b4d6028a01">grib_handle_new_from_message</a> (<a class="el" href="grib__api_8h.html#8e7f259b6dec023add23b2a5ddd93bad">grib_context</a> *c, void *data, size_t data_len)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a handle from a user message in memory. <a href="#gcf9ab4896fac2fbbe30a33b4d6028a01"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grib__handle.html#g5990754a829e1d7a7ae4c5a1a8296bf2">grib_handle_new_from_multi_message</a> (<a class="el" href="grib__api_8h.html#8e7f259b6dec023add23b2a5ddd93bad">grib_context</a> *c, void **data, size_t *data_len, int *error)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a handle from a user message in memory. <a href="#g5990754a829e1d7a7ae4c5a1a8296bf2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grib__handle.html#gba8b4cc36b1a882c8a12716ef011d6be">grib_handle_new_from_message_copy</a> (<a class="el" href="grib__api_8h.html#8e7f259b6dec023add23b2a5ddd93bad">grib_context</a> *c, const void *data, size_t data_len)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a handle from a user message. <a href="#gba8b4cc36b1a882c8a12716ef011d6be"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grib__handle.html#g11d247e5afa10bd52fb895dc4296143f">grib_handle_new_from_template</a> (<a class="el" href="grib__api_8h.html#8e7f259b6dec023add23b2a5ddd93bad">grib_context</a> *c, const char *res_name)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a handle from a read_only template resource. <a href="#g11d247e5afa10bd52fb895dc4296143f"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grib__handle.html#gadefac64c19fb5ff06cf805ad4af06ff">grib_handle_new_from_samples</a> (<a class="el" href="grib__api_8h.html#8e7f259b6dec023add23b2a5ddd93bad">grib_context</a> *c, const char *res_name)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a handle from a message contained in a samples directory. <a href="#gadefac64c19fb5ff06cf805ad4af06ff"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grib__handle.html#ga63c93533fbbe2c8df482e19ca97c651">grib_handle_clone</a> (<a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *h)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Clone an existing handle using the context of the original handle, The message is copied and reparsed. <a href="#ga63c93533fbbe2c8df482e19ca97c651"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grib__handle.html#g0e4b2585f22247c49b930c1579257677">grib_handle_delete</a> (<a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *h)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Frees a handle, also frees the message if it is not a user message. <a href="#g0e4b2585f22247c49b930c1579257677"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="group__grib__handle.html#g569cc40caa2fa0c4e0e22f9a0ecf25f7">grib_multi_handle</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grib__handle.html#g9e1911fcd2b32380937e2d60469d2d22">grib_multi_handle_new</a> (<a class="el" href="grib__api_8h.html#8e7f259b6dec023add23b2a5ddd93bad">grib_context</a> *c)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create an empty multi field handle. <a href="#g9e1911fcd2b32380937e2d60469d2d22"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grib__handle.html#gb723d513ef118d0f2d8c440e15387337">grib_multi_handle_append</a> (<a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *h, int start_section, <a class="el" href="group__grib__handle.html#g569cc40caa2fa0c4e0e22f9a0ecf25f7">grib_multi_handle</a> *mh)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Append the sections starting with start_section of the message pointed by h at the end of the multi field handle mh. <a href="#gb723d513ef118d0f2d8c440e15387337"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grib__handle.html#g706fb50a5a16b6932adb05d27a8ac626">grib_multi_handle_delete</a> (<a class="el" href="group__grib__handle.html#g569cc40caa2fa0c4e0e22f9a0ecf25f7">grib_multi_handle</a> *mh)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Delete multi field handle. <a href="#g706fb50a5a16b6932adb05d27a8ac626"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__grib__handle.html#g48fc85388ca1ee23f6afa12bb0c125ed">grib_multi_handle_write</a> (<a class="el" href="group__grib__handle.html#g569cc40caa2fa0c4e0e22f9a0ecf25f7">grib_multi_handle</a> *mh, FILE *f)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Write a multi field handle in a file. <a href="#g48fc85388ca1ee23f6afa12bb0c125ed"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The grib_handle is the structure giving access to parsed grib values by keys. <hr><h2>Typedef Documentation</h2>
<a class="anchor" name="g309a5ee24f4c730646d3f80ad0ef5f1b"></a><!-- doxytag: member="grib_api.h::grib_handle" ref="g309a5ee24f4c730646d3f80ad0ef5f1b" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> <a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Grib handle, structure giving access to parsed grib values by keys <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="get_8c-example.html#a0">get.c</a>, <a class="el" href="iterator_8c-example.html#a0">iterator.c</a>, <a class="el" href="keys__iterator_8c-example.html#a1">keys_iterator.c</a>, <a class="el" href="multi_8c-example.html#a0">multi.c</a>, <a class="el" href="multi__write_8c-example.html#a0">multi_write.c</a>, <a class="el" href="nearest_8c-example.html#a0">nearest.c</a>, <a class="el" href="precision_8c-example.html#a0">precision.c</a>, <a class="el" href="print__data_8c-example.html#a0">print_data.c</a>, and <a class="el" href="set_8c-example.html#a0">set.c</a>.</dl>
</div>
</div><p>
<a class="anchor" name="g569cc40caa2fa0c4e0e22f9a0ecf25f7"></a><!-- doxytag: member="grib_api.h::grib_multi_handle" ref="g569cc40caa2fa0c4e0e22f9a0ecf25f7" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">typedef struct <a class="el" href="group__grib__handle.html#g569cc40caa2fa0c4e0e22f9a0ecf25f7">grib_multi_handle</a> <a class="el" href="group__grib__handle.html#g569cc40caa2fa0c4e0e22f9a0ecf25f7">grib_multi_handle</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Grib multi field handle, structure used to build multi fields messages. <dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="multi__write_8c-example.html#a1">multi_write.c</a>.</dl>
</div>
</div><p>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="gc7f5cb6af67fd0a42bec5376d5b54682"></a><!-- doxytag: member="grib_api.h::grib_count_in_file" ref="gc7f5cb6af67fd0a42bec5376d5b54682" args="(grib_context *c, FILE *f, int *n)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int grib_count_in_file </td>
<td>(</td>
<td class="paramtype"><a class="el" href="grib__api_8h.html#8e7f259b6dec023add23b2a5ddd93bad">grib_context</a> *&nbsp;</td>
<td class="paramname"> <em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">FILE *&nbsp;</td>
<td class="paramname"> <em>f</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&nbsp;</td>
<td class="paramname"> <em>n</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Counts the messages contained in a file resource.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>: the context from wich the handle will be created (NULL for default context) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>f</em>&nbsp;</td><td>: the file resource </td></tr>
<tr><td valign="top"></td><td valign="top"><em>n</em>&nbsp;</td><td>: the number of messages in the file </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if OK, integer value on error </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="count__messages_8f90-example.html#a0">count_messages.f90</a>.</dl>
</div>
</div><p>
<a class="anchor" name="ga63c93533fbbe2c8df482e19ca97c651"></a><!-- doxytag: member="grib_api.h::grib_handle_clone" ref="ga63c93533fbbe2c8df482e19ca97c651" args="(grib_handle *h)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a>* grib_handle_clone </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *&nbsp;</td>
<td class="paramname"> <em>h</em> </td>
<td>&nbsp;)&nbsp;</td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Clone an existing handle using the context of the original handle, The message is copied and reparsed.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>h</em>&nbsp;</td><td>: The handle to be cloned </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the new handle, NULL if the message is invalid or a problem is encountered </dd></dl>
</div>
</div><p>
<a class="anchor" name="g0e4b2585f22247c49b930c1579257677"></a><!-- doxytag: member="grib_api.h::grib_handle_delete" ref="g0e4b2585f22247c49b930c1579257677" args="(grib_handle *h)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int grib_handle_delete </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *&nbsp;</td>
<td class="paramname"> <em>h</em> </td>
<td>&nbsp;)&nbsp;</td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Frees a handle, also frees the message if it is not a user message.
<p>
<dl class="see" compact><dt><b>See also:</b></dt><dd><a class="el" href="group__grib__handle.html#gcf9ab4896fac2fbbe30a33b4d6028a01" title="Create a handle from a user message in memory.">grib_handle_new_from_message</a> </dd></dl>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>h</em>&nbsp;</td><td>: The handle to be deleted </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if OK, integer value on error </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="get_8c-example.html#a6">get.c</a>, <a class="el" href="iterator_8c-example.html#a8">iterator.c</a>, <a class="el" href="multi_8c-example.html#a4">multi.c</a>, <a class="el" href="multi__write_8c-example.html#a7">multi_write.c</a>, <a class="el" href="nearest_8c-example.html#a6">nearest.c</a>, <a class="el" href="precision_8c-example.html#a7">precision.c</a>, <a class="el" href="print__data_8c-example.html#a5">print_data.c</a>, and <a class="el" href="set_8c-example.html#a6">set.c</a>.</dl>
</div>
</div><p>
<a class="anchor" name="g5e24f8499aa7e4178ccc25a5de3145c5"></a><!-- doxytag: member="grib_api.h::grib_handle_new_from_file" ref="g5e24f8499aa7e4178ccc25a5de3145c5" args="(grib_context *c, FILE *f, int *error)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a>* grib_handle_new_from_file </td>
<td>(</td>
<td class="paramtype"><a class="el" href="grib__api_8h.html#8e7f259b6dec023add23b2a5ddd93bad">grib_context</a> *&nbsp;</td>
<td class="paramname"> <em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">FILE *&nbsp;</td>
<td class="paramname"> <em>f</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&nbsp;</td>
<td class="paramname"> <em>error</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Create a handle from a file resource.
<p>
The file is read until a message is found. The message is then copied. Remember always to delete the handle when it is not needed any more to avoid memory leaks.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>: the context from wich the handle will be created (NULL for default context) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>f</em>&nbsp;</td><td>: the file resource </td></tr>
<tr><td valign="top"></td><td valign="top"><em>error</em>&nbsp;</td><td>: error code set if the returned handle is NULL and the end of file is not reached </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the new handle, NULL if the resource is invalid or a problem is encountered </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="get_8c-example.html#a1">get.c</a>, <a class="el" href="iterator_8c-example.html#a2">iterator.c</a>, <a class="el" href="keys__iterator_8c-example.html#a3">keys_iterator.c</a>, <a class="el" href="multi_8c-example.html#a2">multi.c</a>, <a class="el" href="multi__write_8c-example.html#a2">multi_write.c</a>, <a class="el" href="precision_8c-example.html#a1">precision.c</a>, <a class="el" href="print__data_8c-example.html#a1">print_data.c</a>, and <a class="el" href="set_8c-example.html#a1">set.c</a>.</dl>
</div>
</div><p>
<a class="anchor" name="gcf9ab4896fac2fbbe30a33b4d6028a01"></a><!-- doxytag: member="grib_api.h::grib_handle_new_from_message" ref="gcf9ab4896fac2fbbe30a33b4d6028a01" args="(grib_context *c, void *data, size_t data_len)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a>* grib_handle_new_from_message </td>
<td>(</td>
<td class="paramtype"><a class="el" href="grib__api_8h.html#8e7f259b6dec023add23b2a5ddd93bad">grib_context</a> *&nbsp;</td>
<td class="paramname"> <em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void *&nbsp;</td>
<td class="paramname"> <em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&nbsp;</td>
<td class="paramname"> <em>data_len</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Create a handle from a user message in memory.
<p>
The message will not be freed at the end. The message will be copied as soon as a modification is needed.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>: the context from which the handle will be created (NULL for default context) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>: the actual message </td></tr>
<tr><td valign="top"></td><td valign="top"><em>data_len</em>&nbsp;</td><td>: the length of the message in number of bytes </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the new handle, NULL if the message is invalid or a problem is encountered </dd></dl>
</div>
</div><p>
<a class="anchor" name="gba8b4cc36b1a882c8a12716ef011d6be"></a><!-- doxytag: member="grib_api.h::grib_handle_new_from_message_copy" ref="gba8b4cc36b1a882c8a12716ef011d6be" args="(grib_context *c, const void *data, size_t data_len)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a>* grib_handle_new_from_message_copy </td>
<td>(</td>
<td class="paramtype"><a class="el" href="grib__api_8h.html#8e7f259b6dec023add23b2a5ddd93bad">grib_context</a> *&nbsp;</td>
<td class="paramname"> <em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void *&nbsp;</td>
<td class="paramname"> <em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&nbsp;</td>
<td class="paramname"> <em>data_len</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Create a handle from a user message.
<p>
The message is copied and will be freed with the handle<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>: the context from wich the handle will be created (NULL for default context) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>: the actual message </td></tr>
<tr><td valign="top"></td><td valign="top"><em>data_len</em>&nbsp;</td><td>: the length of the message in number of bytes </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the new handle, NULL if the message is invalid or a problem is encountered </dd></dl>
</div>
</div><p>
<a class="anchor" name="g5990754a829e1d7a7ae4c5a1a8296bf2"></a><!-- doxytag: member="grib_api.h::grib_handle_new_from_multi_message" ref="g5990754a829e1d7a7ae4c5a1a8296bf2" args="(grib_context *c, void **data, size_t *data_len, int *error)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a>* grib_handle_new_from_multi_message </td>
<td>(</td>
<td class="paramtype"><a class="el" href="grib__api_8h.html#8e7f259b6dec023add23b2a5ddd93bad">grib_context</a> *&nbsp;</td>
<td class="paramname"> <em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void **&nbsp;</td>
<td class="paramname"> <em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t *&nbsp;</td>
<td class="paramname"> <em>data_len</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int *&nbsp;</td>
<td class="paramname"> <em>error</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Create a handle from a user message in memory.
<p>
The message will not be freed at the end. The message will be copied as soon as a modification is needed. This function works also with multi field messages.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>: the context from which the handle will be created (NULL for default context) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>: the actual message </td></tr>
<tr><td valign="top"></td><td valign="top"><em>data_len</em>&nbsp;</td><td>: the length of the message in number of bytes </td></tr>
<tr><td valign="top"></td><td valign="top"><em>error</em>&nbsp;</td><td>: error code </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the new handle, NULL if the message is invalid or a problem is encountered </dd></dl>
</div>
</div><p>
<a class="anchor" name="gadefac64c19fb5ff06cf805ad4af06ff"></a><!-- doxytag: member="grib_api.h::grib_handle_new_from_samples" ref="gadefac64c19fb5ff06cf805ad4af06ff" args="(grib_context *c, const char *res_name)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a>* grib_handle_new_from_samples </td>
<td>(</td>
<td class="paramtype"><a class="el" href="grib__api_8h.html#8e7f259b6dec023add23b2a5ddd93bad">grib_context</a> *&nbsp;</td>
<td class="paramname"> <em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&nbsp;</td>
<td class="paramname"> <em>res_name</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Create a handle from a message contained in a samples directory.
<p>
The message is copied at the creation of the handle<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>: the context from wich the handle will be created (NULL for default context) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>res_name</em>&nbsp;</td><td>: the resource name </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the new handle, NULL if the resource is invalid or a problem is encountered </dd></dl>
</div>
</div><p>
<a class="anchor" name="g11d247e5afa10bd52fb895dc4296143f"></a><!-- doxytag: member="grib_api.h::grib_handle_new_from_template" ref="g11d247e5afa10bd52fb895dc4296143f" args="(grib_context *c, const char *res_name)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a>* grib_handle_new_from_template </td>
<td>(</td>
<td class="paramtype"><a class="el" href="grib__api_8h.html#8e7f259b6dec023add23b2a5ddd93bad">grib_context</a> *&nbsp;</td>
<td class="paramname"> <em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char *&nbsp;</td>
<td class="paramname"> <em>res_name</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Create a handle from a read_only template resource.
<p>
The message is copied at the creation of the handle<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>: the context from wich the handle will be created (NULL for default context) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>res_name</em>&nbsp;</td><td>: the resource name </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the new handle, NULL if the resource is invalid or a problem is encountered </dd></dl>
</div>
</div><p>
<a class="anchor" name="gb723d513ef118d0f2d8c440e15387337"></a><!-- doxytag: member="grib_api.h::grib_multi_handle_append" ref="gb723d513ef118d0f2d8c440e15387337" args="(grib_handle *h, int start_section, grib_multi_handle *mh)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int grib_multi_handle_append </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__grib__handle.html#g309a5ee24f4c730646d3f80ad0ef5f1b">grib_handle</a> *&nbsp;</td>
<td class="paramname"> <em>h</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&nbsp;</td>
<td class="paramname"> <em>start_section</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="group__grib__handle.html#g569cc40caa2fa0c4e0e22f9a0ecf25f7">grib_multi_handle</a> *&nbsp;</td>
<td class="paramname"> <em>mh</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Append the sections starting with start_section of the message pointed by h at the end of the multi field handle mh.
<p>
Remember always to delete the multi handle when it is not needed any more to avoid memory leaks.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>h</em>&nbsp;</td><td>: The handle from which the sections are copied. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>start_section</em>&nbsp;</td><td>: section number. Starting from this section all the sections to then end of the message will be copied. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>mh</em>&nbsp;</td><td>: The multi field handle on which the sections are appended. </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if OK, integer value on error </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="multi__write_8c-example.html#a5">multi_write.c</a>.</dl>
</div>
</div><p>
<a class="anchor" name="g706fb50a5a16b6932adb05d27a8ac626"></a><!-- doxytag: member="grib_api.h::grib_multi_handle_delete" ref="g706fb50a5a16b6932adb05d27a8ac626" args="(grib_multi_handle *mh)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int grib_multi_handle_delete </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__grib__handle.html#g569cc40caa2fa0c4e0e22f9a0ecf25f7">grib_multi_handle</a> *&nbsp;</td>
<td class="paramname"> <em>mh</em> </td>
<td>&nbsp;)&nbsp;</td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Delete multi field handle.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>mh</em>&nbsp;</td><td>: The multi field handle to be deleted. </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if OK, integer value on error </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="multi__write_8c-example.html#a8">multi_write.c</a>.</dl>
</div>
</div><p>
<a class="anchor" name="g9e1911fcd2b32380937e2d60469d2d22"></a><!-- doxytag: member="grib_api.h::grib_multi_handle_new" ref="g9e1911fcd2b32380937e2d60469d2d22" args="(grib_context *c)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="group__grib__handle.html#g569cc40caa2fa0c4e0e22f9a0ecf25f7">grib_multi_handle</a>* grib_multi_handle_new </td>
<td>(</td>
<td class="paramtype"><a class="el" href="grib__api_8h.html#8e7f259b6dec023add23b2a5ddd93bad">grib_context</a> *&nbsp;</td>
<td class="paramname"> <em>c</em> </td>
<td>&nbsp;)&nbsp;</td>
<td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Create an empty multi field handle.
<p>
Remember always to delete the multi handle when it is not needed any more to avoid memory leaks.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>c</em>&nbsp;</td><td>: the context from wich the handle will be created (NULL for default context) </td></tr>
</table>
</dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="multi__write_8c-example.html#a3">multi_write.c</a>.</dl>
</div>
</div><p>
<a class="anchor" name="g48fc85388ca1ee23f6afa12bb0c125ed"></a><!-- doxytag: member="grib_api.h::grib_multi_handle_write" ref="g48fc85388ca1ee23f6afa12bb0c125ed" args="(grib_multi_handle *mh, FILE *f)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int grib_multi_handle_write </td>
<td>(</td>
<td class="paramtype"><a class="el" href="group__grib__handle.html#g569cc40caa2fa0c4e0e22f9a0ecf25f7">grib_multi_handle</a> *&nbsp;</td>
<td class="paramname"> <em>mh</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">FILE *&nbsp;</td>
<td class="paramname"> <em>f</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td width="100%"></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Write a multi field handle in a file.
<p>
Remember always to delete the multi handle when it is not needed any more to avoid memory leaks.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>mh</em>&nbsp;</td><td>: The multi field handle to be written. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>f</em>&nbsp;</td><td>: File on which the file handle is written. </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if OK, integer value on error </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="multi__write_8c-example.html#a6">multi_write.c</a>.</dl>
</div>
</div><p>
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Sep 22 15:18:22 2009 for grib_api by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
</body>
</html>