1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>eccodes: The message handle</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">eccodes
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="modules.html"><span>C Interface</span></a></li>
<li><a href="classeccodes.html"><span>F90 Interface</span></a></li>
<li><a href="namespaces.html"><span>Python Interface</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Pages</a></div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Data Structures</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">The message handle</div> </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structcodes__handle.html">codes_handle</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structcodes__multi__handle.html">codes_multi_handle</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga4c2203d55c2c3ca792e44e4eb26edfb5"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__codes__handle.html#ga4c2203d55c2c3ca792e44e4eb26edfb5">codes_count_in_file</a> (<a class="el" href="structcodes__context.html">codes_context</a> *c, FILE *f, int *n)</td></tr>
<tr class="memdesc:ga4c2203d55c2c3ca792e44e4eb26edfb5"><td class="mdescLeft"> </td><td class="mdescRight">Counts the messages contained in a file resource. <a href="#ga4c2203d55c2c3ca792e44e4eb26edfb5">More...</a><br/></td></tr>
<tr class="separator:ga4c2203d55c2c3ca792e44e4eb26edfb5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga6ec42bd6272b4a0f2cb2b220b86c71c8"><td class="memItemLeft" align="right" valign="top">grib_handle * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__codes__handle.html#ga6ec42bd6272b4a0f2cb2b220b86c71c8">codes_handle_new_from_file</a> (grib_context *c, FILE *f, ProductKind product, int *error)</td></tr>
<tr class="memdesc:ga6ec42bd6272b4a0f2cb2b220b86c71c8"><td class="mdescLeft"> </td><td class="mdescRight">Create a handle from a file resource. <a href="#ga6ec42bd6272b4a0f2cb2b220b86c71c8">More...</a><br/></td></tr>
<tr class="separator:ga6ec42bd6272b4a0f2cb2b220b86c71c8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga36de77229cc3b386d26c1e7b52c21e0e"><td class="memItemLeft" align="right" valign="top">grib_handle * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__codes__handle.html#ga36de77229cc3b386d26c1e7b52c21e0e">codes_grib_handle_new_from_file</a> (grib_context *c, FILE *f, int *error)</td></tr>
<tr class="memdesc:ga36de77229cc3b386d26c1e7b52c21e0e"><td class="mdescLeft"> </td><td class="mdescRight">Create a GRIB handle from a file resource. <a href="#ga36de77229cc3b386d26c1e7b52c21e0e">More...</a><br/></td></tr>
<tr class="separator:ga36de77229cc3b386d26c1e7b52c21e0e"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga6958c3cd7e4059af5c26898a872262ff"><td class="memItemLeft" align="right" valign="top">grib_handle * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__codes__handle.html#ga6958c3cd7e4059af5c26898a872262ff">codes_bufr_handle_new_from_file</a> (grib_context *c, FILE *f, int *error)</td></tr>
<tr class="memdesc:ga6958c3cd7e4059af5c26898a872262ff"><td class="mdescLeft"> </td><td class="mdescRight">Create a BUFR handle from a file resource. <a href="#ga6958c3cd7e4059af5c26898a872262ff">More...</a><br/></td></tr>
<tr class="separator:ga6958c3cd7e4059af5c26898a872262ff"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gac82dbaba240ebf6e76cdbcf2007a6bee"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__codes__handle.html#gac82dbaba240ebf6e76cdbcf2007a6bee">codes_write_message</a> (<a class="el" href="structcodes__handle.html">codes_handle</a> *h, const char *file, const char *mode)</td></tr>
<tr class="memdesc:gac82dbaba240ebf6e76cdbcf2007a6bee"><td class="mdescLeft"> </td><td class="mdescRight">Write a coded message to a file. <a href="#gac82dbaba240ebf6e76cdbcf2007a6bee">More...</a><br/></td></tr>
<tr class="separator:gac82dbaba240ebf6e76cdbcf2007a6bee"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga095447ed85ff2142dbda2867ee3b4c8d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcodes__handle.html">codes_handle</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__codes__handle.html#ga095447ed85ff2142dbda2867ee3b4c8d">codes_handle_new_from_message</a> (<a class="el" href="structcodes__context.html">codes_context</a> *c, const void *data, size_t data_len)</td></tr>
<tr class="memdesc:ga095447ed85ff2142dbda2867ee3b4c8d"><td class="mdescLeft"> </td><td class="mdescRight">Create a handle from a user message in memory. <a href="#ga095447ed85ff2142dbda2867ee3b4c8d">More...</a><br/></td></tr>
<tr class="separator:ga095447ed85ff2142dbda2867ee3b4c8d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga385864d5f06e1de0e8ee13388ca4117c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcodes__handle.html">codes_handle</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__codes__handle.html#ga385864d5f06e1de0e8ee13388ca4117c">codes_grib_handle_new_from_multi_message</a> (<a class="el" href="structcodes__context.html">codes_context</a> *c, void **data, size_t *data_len, int *error)</td></tr>
<tr class="memdesc:ga385864d5f06e1de0e8ee13388ca4117c"><td class="mdescLeft"> </td><td class="mdescRight">Create a handle from a user message in memory. <a href="#ga385864d5f06e1de0e8ee13388ca4117c">More...</a><br/></td></tr>
<tr class="separator:ga385864d5f06e1de0e8ee13388ca4117c"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga079df0c709e381812ae13af08c354032"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcodes__handle.html">codes_handle</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__codes__handle.html#ga079df0c709e381812ae13af08c354032">codes_handle_new_from_message_copy</a> (<a class="el" href="structcodes__context.html">codes_context</a> *c, const void *data, size_t data_len)</td></tr>
<tr class="memdesc:ga079df0c709e381812ae13af08c354032"><td class="mdescLeft"> </td><td class="mdescRight">Create a handle from a user message. <a href="#ga079df0c709e381812ae13af08c354032">More...</a><br/></td></tr>
<tr class="separator:ga079df0c709e381812ae13af08c354032"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga3b281a237e311c6b8fa4bd7096d7e025"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcodes__handle.html">codes_handle</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__codes__handle.html#ga3b281a237e311c6b8fa4bd7096d7e025">codes_grib_handle_new_from_samples</a> (<a class="el" href="structcodes__context.html">codes_context</a> *c, const char *sample_name)</td></tr>
<tr class="memdesc:ga3b281a237e311c6b8fa4bd7096d7e025"><td class="mdescLeft"> </td><td class="mdescRight">Create a handle from a GRIB message contained in a samples directory. <a href="#ga3b281a237e311c6b8fa4bd7096d7e025">More...</a><br/></td></tr>
<tr class="separator:ga3b281a237e311c6b8fa4bd7096d7e025"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga56d0f831e520ec7bc4a0ca334c63f557"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcodes__handle.html">codes_handle</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__codes__handle.html#ga56d0f831e520ec7bc4a0ca334c63f557">codes_bufr_handle_new_from_samples</a> (<a class="el" href="structcodes__context.html">codes_context</a> *c, const char *sample_name)</td></tr>
<tr class="memdesc:ga56d0f831e520ec7bc4a0ca334c63f557"><td class="mdescLeft"> </td><td class="mdescRight">Create a handle from a BUFR message contained in a samples directory. <a href="#ga56d0f831e520ec7bc4a0ca334c63f557">More...</a><br/></td></tr>
<tr class="separator:ga56d0f831e520ec7bc4a0ca334c63f557"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga7b226527aa98d90f2bdb470105732878"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcodes__handle.html">codes_handle</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__codes__handle.html#ga7b226527aa98d90f2bdb470105732878">codes_handle_clone</a> (<a class="el" href="structcodes__handle.html">codes_handle</a> *h)</td></tr>
<tr class="memdesc:ga7b226527aa98d90f2bdb470105732878"><td class="mdescLeft"> </td><td class="mdescRight">Clone an existing handle using the context of the original handle, The message is copied and reparsed. <a href="#ga7b226527aa98d90f2bdb470105732878">More...</a><br/></td></tr>
<tr class="separator:ga7b226527aa98d90f2bdb470105732878"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga358ea000ceed775e7367ccab581be978"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__codes__handle.html#ga358ea000ceed775e7367ccab581be978">codes_handle_delete</a> (<a class="el" href="structcodes__handle.html">codes_handle</a> *h)</td></tr>
<tr class="memdesc:ga358ea000ceed775e7367ccab581be978"><td class="mdescLeft"> </td><td class="mdescRight">Frees a handle, also frees the message if it is not a user message. <a href="#ga358ea000ceed775e7367ccab581be978">More...</a><br/></td></tr>
<tr class="separator:ga358ea000ceed775e7367ccab581be978"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga5ff59672d9eab49c0285c8f60e379d88"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structcodes__multi__handle.html">codes_multi_handle</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="group__codes__handle.html#ga5ff59672d9eab49c0285c8f60e379d88">codes_grib_multi_handle_new</a> (<a class="el" href="structcodes__context.html">codes_context</a> *c)</td></tr>
<tr class="memdesc:ga5ff59672d9eab49c0285c8f60e379d88"><td class="mdescLeft"> </td><td class="mdescRight">Create an empty multi-field GRIB handle. <a href="#ga5ff59672d9eab49c0285c8f60e379d88">More...</a><br/></td></tr>
<tr class="separator:ga5ff59672d9eab49c0285c8f60e379d88"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga068715aab8b82a5d3092064b6bc27f3d"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__codes__handle.html#ga068715aab8b82a5d3092064b6bc27f3d">codes_grib_multi_handle_append</a> (<a class="el" href="structcodes__handle.html">codes_handle</a> *h, int start_section, <a class="el" href="structcodes__multi__handle.html">codes_multi_handle</a> *mh)</td></tr>
<tr class="memdesc:ga068715aab8b82a5d3092064b6bc27f3d"><td class="mdescLeft"> </td><td class="mdescRight">Append the sections starting with start_section of the message pointed by h at the end of the multi-field GRIB handle mh. <a href="#ga068715aab8b82a5d3092064b6bc27f3d">More...</a><br/></td></tr>
<tr class="separator:ga068715aab8b82a5d3092064b6bc27f3d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga85a955bdd3012ce499e50768e298b849"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__codes__handle.html#ga85a955bdd3012ce499e50768e298b849">codes_grib_multi_handle_delete</a> (<a class="el" href="structcodes__multi__handle.html">codes_multi_handle</a> *mh)</td></tr>
<tr class="memdesc:ga85a955bdd3012ce499e50768e298b849"><td class="mdescLeft"> </td><td class="mdescRight">Delete multi-field GRIB handle. <a href="#ga85a955bdd3012ce499e50768e298b849">More...</a><br/></td></tr>
<tr class="separator:ga85a955bdd3012ce499e50768e298b849"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gac06089d897eea71d8944cc622a45737f"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group__codes__handle.html#gac06089d897eea71d8944cc622a45737f">codes_grib_multi_handle_write</a> (<a class="el" href="structcodes__multi__handle.html">codes_multi_handle</a> *mh, FILE *f)</td></tr>
<tr class="memdesc:gac06089d897eea71d8944cc622a45737f"><td class="mdescLeft"> </td><td class="mdescRight">Write a multi-field GRIB handle in a file. <a href="#gac06089d897eea71d8944cc622a45737f">More...</a><br/></td></tr>
<tr class="separator:gac06089d897eea71d8944cc622a45737f"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>The <a class="el" href="structcodes__handle.html">codes_handle</a> is the structure giving access to parsed message values by keys. </p>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga6958c3cd7e4059af5c26898a872262ff"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">grib_handle* codes_bufr_handle_new_from_file </td>
<td>(</td>
<td class="paramtype">grib_context * </td>
<td class="paramname"><em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">FILE * </td>
<td class="paramname"><em>f</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>error</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a BUFR handle from a file resource. </p>
<p>The file is read until a BUFR message is found. The message is then copied. Remember always to delete the handle when it is not needed anymore to avoid memory leaks.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">c</td><td>: the context from which the handle will be created (NULL for default context) </td></tr>
<tr><td class="paramname">f</td><td>: the file resource </td></tr>
<tr><td class="paramname">error</td><td>: error code set if the returned handle is NULL and the end of file is not reached </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the new handle, NULL if the resource is invalid or a problem is encountered </dd></dl>
</div>
</div>
<a class="anchor" id="ga56d0f831e520ec7bc4a0ca334c63f557"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structcodes__handle.html">codes_handle</a>* codes_bufr_handle_new_from_samples </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcodes__context.html">codes_context</a> * </td>
<td class="paramname"><em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>sample_name</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a handle from a BUFR message contained in a samples directory. </p>
<p>The message is copied at the creation of the handle</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">c</td><td>: the context from which the handle will be created (NULL for default context) </td></tr>
<tr><td class="paramname">sample_name</td><td>: the name of the sample file (without the .tmpl extension) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the new handle, NULL if the resource is invalid or a problem is encountered </dd></dl>
</div>
</div>
<a class="anchor" id="ga4c2203d55c2c3ca792e44e4eb26edfb5"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int codes_count_in_file </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcodes__context.html">codes_context</a> * </td>
<td class="paramname"><em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">FILE * </td>
<td class="paramname"><em>f</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>n</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Counts the messages contained in a file resource. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">c</td><td>: the context from which the handle will be created (NULL for default context) </td></tr>
<tr><td class="paramname">f</td><td>: the file resource </td></tr>
<tr><td class="paramname">n</td><td>: the number of messages in the file </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if OK, integer value on error </dd></dl>
</div>
</div>
<a class="anchor" id="ga36de77229cc3b386d26c1e7b52c21e0e"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">grib_handle* codes_grib_handle_new_from_file </td>
<td>(</td>
<td class="paramtype">grib_context * </td>
<td class="paramname"><em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">FILE * </td>
<td class="paramname"><em>f</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>error</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a GRIB handle from a file resource. </p>
<p>The file is read until a GRIB message is found. The message is then copied. Remember always to delete the handle when it is not needed anymore to avoid memory leaks.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">c</td><td>: the context from which the handle will be created (NULL for default context) </td></tr>
<tr><td class="paramname">f</td><td>: the file resource </td></tr>
<tr><td class="paramname">error</td><td>: error code set if the returned handle is NULL and the end of file is not reached </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the new handle, NULL if the resource is invalid or a problem is encountered </dd></dl>
</div>
</div>
<a class="anchor" id="ga385864d5f06e1de0e8ee13388ca4117c"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structcodes__handle.html">codes_handle</a>* codes_grib_handle_new_from_multi_message </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcodes__context.html">codes_context</a> * </td>
<td class="paramname"><em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">void ** </td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t * </td>
<td class="paramname"><em>data_len</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>error</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a handle from a user message in memory. </p>
<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 class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">c</td><td>: the context from which the handle will be created (NULL for default context) </td></tr>
<tr><td class="paramname">data</td><td>: the actual message </td></tr>
<tr><td class="paramname">data_len</td><td>: the length of the message in number of bytes </td></tr>
<tr><td class="paramname">error</td><td>: error code </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the new handle, NULL if the message is invalid or a problem is encountered </dd></dl>
</div>
</div>
<a class="anchor" id="ga3b281a237e311c6b8fa4bd7096d7e025"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structcodes__handle.html">codes_handle</a>* codes_grib_handle_new_from_samples </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcodes__context.html">codes_context</a> * </td>
<td class="paramname"><em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>sample_name</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a handle from a GRIB message contained in a samples directory. </p>
<p>The message is copied at the creation of the handle</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">c</td><td>: the context from which the handle will be created (NULL for default context) </td></tr>
<tr><td class="paramname">sample_name</td><td>: the name of the sample file (without the .tmpl extension) </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the new handle, NULL if the resource is invalid or a problem is encountered </dd></dl>
</div>
</div>
<a class="anchor" id="ga068715aab8b82a5d3092064b6bc27f3d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int codes_grib_multi_handle_append </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcodes__handle.html">codes_handle</a> * </td>
<td class="paramname"><em>h</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int </td>
<td class="paramname"><em>start_section</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="structcodes__multi__handle.html">codes_multi_handle</a> * </td>
<td class="paramname"><em>mh</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></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 GRIB handle mh. </p>
<p>Remember always to delete the multi-handle when it is not needed any more to avoid memory leaks.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">h</td><td>: The handle from which the sections are copied. </td></tr>
<tr><td class="paramname">start_section</td><td>: section number. Starting from this section all the sections to the end of the message will be copied. </td></tr>
<tr><td class="paramname">mh</td><td>: The multi-field handle on which the sections are appended. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if OK, integer value on error </dd></dl>
</div>
</div>
<a class="anchor" id="ga85a955bdd3012ce499e50768e298b849"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int codes_grib_multi_handle_delete </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcodes__multi__handle.html">codes_multi_handle</a> * </td>
<td class="paramname"><em>mh</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Delete multi-field GRIB handle. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">mh</td><td>: The multi-field handle to be deleted. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if OK, integer value on error </dd></dl>
</div>
</div>
<a class="anchor" id="ga5ff59672d9eab49c0285c8f60e379d88"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structcodes__multi__handle.html">codes_multi_handle</a>* codes_grib_multi_handle_new </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcodes__context.html">codes_context</a> * </td>
<td class="paramname"><em>c</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create an empty multi-field GRIB handle. </p>
<p>Remember always to delete the multi-handle when it is not needed any more to avoid memory leaks.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">c</td><td>: the context from which the handle will be created (NULL for default context) </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="gac06089d897eea71d8944cc622a45737f"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int codes_grib_multi_handle_write </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcodes__multi__handle.html">codes_multi_handle</a> * </td>
<td class="paramname"><em>mh</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">FILE * </td>
<td class="paramname"><em>f</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Write a multi-field GRIB handle in a file. </p>
<p>Remember always to delete the multi-handle when it is not needed any more to avoid memory leaks.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">mh</td><td>: The multi-field GRIB handle to be written. </td></tr>
<tr><td class="paramname">f</td><td>: File on which the file handle is written. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if OK, integer value on error </dd></dl>
</div>
</div>
<a class="anchor" id="ga7b226527aa98d90f2bdb470105732878"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structcodes__handle.html">codes_handle</a>* codes_handle_clone </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcodes__handle.html">codes_handle</a> * </td>
<td class="paramname"><em>h</em></td><td>)</td>
<td></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 class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">h</td><td>: The handle to be cloned </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the new handle, NULL if the message is invalid or a problem is encountered </dd></dl>
</div>
</div>
<a class="anchor" id="ga358ea000ceed775e7367ccab581be978"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int codes_handle_delete </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcodes__handle.html">codes_handle</a> * </td>
<td class="paramname"><em>h</em></td><td>)</td>
<td></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="section see"><dt>See Also</dt><dd><a class="el" href="group__codes__handle.html#ga095447ed85ff2142dbda2867ee3b4c8d" title="Create a handle from a user message in memory. ">codes_handle_new_from_message</a> </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">h</td><td>: The handle to be deleted </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if OK, integer value on error </dd></dl>
</div>
</div>
<a class="anchor" id="ga6ec42bd6272b4a0f2cb2b220b86c71c8"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">grib_handle* codes_handle_new_from_file </td>
<td>(</td>
<td class="paramtype">grib_context * </td>
<td class="paramname"><em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">FILE * </td>
<td class="paramname"><em>f</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">ProductKind </td>
<td class="paramname"><em>product</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int * </td>
<td class="paramname"><em>error</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a handle from a file resource. </p>
<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 anymore to avoid memory leaks.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">c</td><td>: the context from which the handle will be created (NULL for default context) </td></tr>
<tr><td class="paramname">f</td><td>: the file resource </td></tr>
<tr><td class="paramname">product</td><td>: the kind of product e.g. PRODUCT_GRIB, PRODUCT_BUFR </td></tr>
<tr><td class="paramname">error</td><td>: error code set if the returned handle is NULL and the end of file is not reached </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the new handle, NULL if the resource is invalid or a problem is encountered </dd></dl>
</div>
</div>
<a class="anchor" id="ga095447ed85ff2142dbda2867ee3b4c8d"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structcodes__handle.html">codes_handle</a>* codes_handle_new_from_message </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcodes__context.html">codes_context</a> * </td>
<td class="paramname"><em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void * </td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>data_len</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a handle from a user message in memory. </p>
<p>The message will not be freed at the end. The message will be copied as soon as a modification is needed.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">c</td><td>: the context from which the handle will be created (NULL for default context) </td></tr>
<tr><td class="paramname">data</td><td>: the actual message </td></tr>
<tr><td class="paramname">data_len</td><td>: the length of the message in number of bytes </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the new handle, NULL if the message is invalid or a problem is encountered </dd></dl>
</div>
</div>
<a class="anchor" id="ga079df0c709e381812ae13af08c354032"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="structcodes__handle.html">codes_handle</a>* codes_handle_new_from_message_copy </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcodes__context.html">codes_context</a> * </td>
<td class="paramname"><em>c</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void * </td>
<td class="paramname"><em>data</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>data_len</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create a handle from a user message. </p>
<p>The message is copied and will be freed with the handle</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">c</td><td>: the context from which the handle will be created (NULL for default context) </td></tr>
<tr><td class="paramname">data</td><td>: the actual message </td></tr>
<tr><td class="paramname">data_len</td><td>: the length of the message in number of bytes </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the new handle, NULL if the message is invalid or a problem is encountered </dd></dl>
</div>
</div>
<a class="anchor" id="gac82dbaba240ebf6e76cdbcf2007a6bee"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int codes_write_message </td>
<td>(</td>
<td class="paramtype"><a class="el" href="structcodes__handle.html">codes_handle</a> * </td>
<td class="paramname"><em>h</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>file</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const char * </td>
<td class="paramname"><em>mode</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Write a coded message to a file. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">h</td><td>: <a class="el" href="structcodes__handle.html">codes_handle</a> to be written </td></tr>
<tr><td class="paramname">file</td><td>: name of the output file </td></tr>
<tr><td class="paramname">mode</td><td>: mode </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>0 if OK, integer value on error </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
|