"""Unit tests for contextlib.py, and other context managers.""" import sys import tempfile import unittest from contextlib import * # Tests __all__ from test import support try: import threading except ImportError: threading = None class ContextManagerTestCase(unittest.TestCase): def test_contextmanager_plain(self): state = [] @contextmanager def woohoo(): state.append(1) yield 42 state.append(999) with woohoo() as x: self.assertEqual(state, [1]) self.assertEqual(x, 42) state.append(x) self.assertEqual(state, [1, 42, 999]) def test_contextmanager_finally(self): state = [] @contextmanager def woohoo(): state.append(1) try: yield 42 finally: state.append(999) with self.assertRaises(ZeroDivisionError): with woohoo() as x: self.assertEqual(state, [1]) self.assertEqual(x, 42) state.append(x) raise ZeroDivisionError() self.assertEqual(state, [1, 42, 999]) def test_contextmanager_no_reraise(self): @contextmanager def whee(): yield ctx = whee() ctx.__enter__() # Calling __exit__ should not result in an exception self.assertFalse(ctx.__exit__(TypeError, TypeError("foo"), None)) def test_contextmanager_trap_yield_after_throw(self): @contextmanager def whoo(): try: yield except: yield ctx = whoo() ctx.__enter__() self.assertRaises( RuntimeError, ctx.__exit__, TypeError, TypeError("foo"), None ) def test_contextmanager_except(self): state = [] @contextmanager def woohoo(): state.append(1) try: yield 42 except ZeroDivisionError as e: state.append(e.args[0]) self.assertEqual(state, [1, 42, 999]) with woohoo() as x: self.assertEqual(state, [1]) self.assertEqual(x, 42) state.append(x) raise ZeroDivisionError(999) self.assertEqual(state, [1, 42, 999]) def _create_contextmanager_attribs(self): def attribs(**kw): def decorate(func): for k,v in kw.items(): setattr(func,k,v) return func return decorate @contextmanager @attribs(foo='bar') def baz(spam): """Whee!""" return baz def test_contextmanager_attribs(self): baz = self._create_contextmanager_attribs() self.assertEqual(baz.__name__,'baz') self.assertEqual(baz.foo, 'bar') @unittest.skipIf(sys.flags.optimize >= 2, "Docstrings are omitted with -O2 and above") def test_contextmanager_doc_attrib(self): baz = self._create_contextmanager_attribs() self.assertEqual(baz.__doc__, "Whee!") class ClosingTestCase(unittest.TestCase): # XXX This needs more work def test_closing(self): state = [] class C: def close(self): state.append(1) x = C() self.assertEqual(state, []) with closing(x) as y: self.assertEqual(x, y) self.assertEqual(state, [1]) def test_closing_error(self): state = [] class C: def close(self): state.append(1) x = C() self.assertEqual(state, []) with self.assertRaises(ZeroDivisionError): with closing(x) as y: self.assertEqual(x, y) 1 / 0 self.assertEqual(state, [1]) class FileContextTestCase(unittest.TestCase): def testWithOpen(self): tfn = tempfile.mktemp() try: f = None with open(tfn, "w") as f: self.assertFalse(f.closed) f.write("Booh\n") self.assertTrue(f.closed) f = None with self.assertRaises(ZeroDivisionError): with open(tfn, "r") as f: self.assertFalse(f.closed) self.assertEqual(f.read(), "Booh\n") 1 / 0 self.assertTrue(f.closed) finally: support.unlink(tfn) @unittest.skipUnless(threading, 'Threading required for this test.') class LockContextTestCase(unittest.TestCase): def boilerPlate(self, lock, locked): self.assertFalse(locked()) with lock: self.assertTrue(locked()) self.assertFalse(locked()) with self.assertRaises(ZeroDivisionError): with lock: self.assertTrue(locked()) 1 / 0 self.assertFalse(locked()) def testWithLock(self): lock = threading.Lock() self.boilerPlate(lock, lock.locked) def testWithRLock(self): lock = threading.RLock() self.boilerPlate(lock, lock._is_owned) def testWithCondition(self): lock = threading.Condition() def locked(): return lock._is_owned() self.boilerPlate(lock, locked) def testWithSemaphore(self): lock = threading.Semaphore() def locked(): if lock.acquire(False): lock.release() return False else: return True self.boilerPlate(lock, locked) def testWithBoundedSemaphore(self): lock = threading.BoundedSemaphore() def locked(): if lock.acquire(False): lock.release() return False else: return True self.boilerPlate(lock, locked) class mycontext(ContextDecorator): started = False exc = None catch = False def __enter__(self): self.started = True return self def __exit__(self, *exc): self.exc = exc return self.catch class TestContextDecorator(unittest.TestCase): def test_contextdecorator(self): context = mycontext() with context as result: self.assertIs(result, context) self.assertTrue(context.started) self.assertEqual(context.exc, (None, None, None)) def test_contextdecorator_with_exception(self): context = mycontext() with self.assertRaisesRegex(NameError, 'foo'): with context: raise NameError('foo') self.assertIsNotNone(context.exc) self.assertIs(context.exc[0], NameError) context = mycontext() context.catch = True with context: raise NameError('foo') self.assertIsNotNone(context.exc) self.assertIs(context.exc[0], NameError) def test_decorator(self): context = mycontext() @context def test(): self.assertIsNone(context.exc) self.assertTrue(context.started) test() self.assertEqual(context.exc, (None, None, None)) def test_decorator_with_exception(self): context = mycontext() @context def test(): self.assertIsNone(context.exc) self.assertTrue(context.started) raise NameError('foo') with self.assertRaisesRegex(NameError, 'foo'): test() self.assertIsNotNone(context.exc) self.assertIs(context.exc[0], NameError) def test_decorating_method(self): context = mycontext() class Test(object): @context def method(self, a, b, c=None): self.a = a self.b = b self.c = c # these tests are for argument passing when used as a decorator test = Test() test.method(1, 2) self.assertEqual(test.a, 1) self.assertEqual(test.b, 2) self.assertEqual(test.c, None) test = Test() test.method('a', 'b', 'c') self.assertEqual(test.a, 'a') self.assertEqual(test.b, 'b') self.assertEqual(test.c, 'c') test = Test() test.method(a=1, b=2) self.assertEqual(test.a, 1) self.assertEqual(test.b, 2) def test_typo_enter(self): class mycontext(ContextDecorator): def __unter__(self): pass def __exit__(self, *exc): pass with self.assertRaises(AttributeError): with mycontext(): pass def test_typo_exit(self): class mycontext(ContextDecorator): def __enter__(self): pass def __uxit__(self, *exc): pass with self.assertRaises(AttributeError): with mycontext(): pass def test_contextdecorator_as_mixin(self): class somecontext(object): started = False exc = None def __enter__(self): self.started = True return self def __exit__(self, *exc): self.exc = exc class mycontext(somecontext, ContextDecorator): pass context = mycontext() @context def test(): self.assertIsNone(context.exc) self.assertTrue(context.started) test() self.assertEqual(context.exc, (None, None, None)) def test_contextmanager_as_decorator(self): @contextmanager def woohoo(y): state.append(y) yield state.append(999) state = [] @woohoo(1) def test(x): self.assertEqual(state, [1]) state.append(x) test('something') self.assertEqual(state, [1, 'something', 999]) # Issue #11647: Ensure the decorated function is 'reusable' state = [] test('something else') self.assertEqual(state, [1, 'something else', 999]) class TestExitStack(unittest.TestCase): def test_no_resources(self): with ExitStack(): pass def test_callback(self): expected = [ ((), {}), ((1,), {}), ((1,2), {}), ((), dict(example=1)), ((1,), dict(example=1)), ((1,2), dict(example=1)), ] result = [] def _exit(*args, **kwds): """Test metadata propagation""" result.append((args, kwds)) with ExitStack() as stack: for args, kwds in reversed(expected): if args and kwds: f = stack.callback(_exit, *args, **kwds) elif args: f = stack.callback(_exit, *args) elif kwds: f = stack.callback(_exit, **kwds) else: f = stack.callback(_exit) self.assertIs(f, _exit) for wrapper in stack._exit_callbacks: self.assertIs(wrapper.__wrapped__, _exit) self.assertNotEqual(wrapper.__name__, _exit.__name__) self.assertIsNone(wrapper.__doc__, _exit.__doc__) self.assertEqual(result, expected) def test_push(self): exc_raised = ZeroDivisionError def _expect_exc(exc_type, exc, exc_tb): self.assertIs(exc_type, exc_raised) def _suppress_exc(*exc_details): return True def _expect_ok(exc_type, exc, exc_tb): self.assertIsNone(exc_type) self.assertIsNone(exc) self.assertIsNone(exc_tb) class ExitCM(object): def __init__(self, check_exc): self.check_exc = check_exc def __enter__(self): self.fail("Should not be called!") def __exit__(self, *exc_details): self.check_exc(*exc_details) with ExitStack() as stack: stack.push(_expect_ok) self.assertIs(stack._exit_callbacks[-1], _expect_ok) cm = ExitCM(_expect_ok) stack.push(cm) self.assertIs(stack._exit_callbacks[-1].__self__, cm) stack.push(_suppress_exc) self.assertIs(stack._exit_callbacks[-1], _suppress_exc) cm = ExitCM(_expect_exc) stack.push(cm) self.assertIs(stack._exit_callbacks[-1].__self__, cm) stack.push(_expect_exc) self.assertIs(stack._exit_callbacks[-1], _expect_exc) stack.push(_expect_exc) self.assertIs(stack._exit_callbacks[-1], _expect_exc) 1/0 def test_enter_context(self): class TestCM(object): def __enter__(self): result.append(1) def __exit__(self, *exc_details): result.append(3) result = [] cm = TestCM() with ExitStack() as stack: @stack.callback # Registered first => cleaned up last def _exit(): result.append(4) self.assertIsNotNone(_exit) stack.enter_context(cm) self.assertIs(stack._exit_callbacks[-1].__self__, cm) result.append(2) self.assertEqual(result, [1, 2, 3, 4]) def test_close(self): result = [] with ExitStack() as stack: @stack.callback def _exit(): result.append(1) self.assertIsNotNone(_exit) stack.close() result.append(2) self.assertEqual(result, [1, 2]) def test_pop_all(self): result = [] with ExitStack() as stack: @stack.callback def _exit(): result.append(3) self.assertIsNotNone(_exit) new_stack = stack.pop_all() result.append(1) result.append(2) new_stack.close() self.assertEqual(result, [1, 2, 3]) def test_exit_raise(self): with self.assertRaises(ZeroDivisionError): with ExitStack() as stack: stack.push(lambda *exc: False) 1/0 def test_exit_suppress(self): with ExitStack() as stack: stack.push(lambda *exc: True) 1/0 def test_exit_exception_chaining_reference(self): # Sanity check to make sure that ExitStack chaining matches # actual nested with statements class RaiseExc: def __init__(self, exc): self.exc = exc def __enter__(self): return self def __exit__(self, *exc_details): raise self.exc class RaiseExcWithContext: def __init__(self, outer, inner): self.outer = outer self.inner = inner def __enter__(self): return self def __exit__(self, *exc_details): try: raise self.inner except: raise self.outer class SuppressExc: def __enter__(self): return self def __exit__(self, *exc_details): type(self).saved_details = exc_details return True try: with RaiseExc(IndexError): with RaiseExcWithContext(KeyError, AttributeError): with SuppressExc(): with RaiseExc(ValueError): 1 / 0 except IndexError as exc: self.assertIsInstance(exc.__context__, KeyError) self.assertIsInstance(exc.__context__.__context__, AttributeError) # Inner exceptions were suppressed self.assertIsNone(exc.__context__.__context__.__context__) else: self.fail("Expected IndexError, but no exception was raised") # Check the inner exceptions inner_exc = SuppressExc.saved_details[1] self.assertIsInstance(inner_exc, ValueError) self.assertIsInstance(inner_exc.__context__, ZeroDivisionError) def test_exit_exception_chaining(self): # Ensure exception chaining matches the reference behaviour def raise_exc(exc): raise exc saved_details = None def suppress_exc(*exc_details): nonlocal saved_details saved_details = exc_details return True try: with ExitStack() as stack: stack.callback(raise_exc, IndexError) stack.callback(raise_exc, KeyError) stack.callback(raise_exc, AttributeError) stack.push(suppress_exc) stack.callback(raise_exc, ValueError) 1 / 0 except IndexError as exc: self.assertIsInstance(exc.__context__, KeyError) self.assertIsInstance(exc.__context__.__context__, AttributeError) # Inner exceptions were suppressed self.assertIsNone(exc.__context__.__context__.__context__) else: self.fail("Expected IndexError, but no exception was raised") # Check the inner exceptions inner_exc = saved_details[1] self.assertIsInstance(inner_exc, ValueError) self.assertIsInstance(inner_exc.__context__, ZeroDivisionError) def test_exit_exception_non_suppressing(self): # http://bugs.python.org/issue19092 def raise_exc(exc): raise exc def suppress_exc(*exc_details): return True try: with ExitStack() as stack: stack.callback(lambda: None) stack.callback(raise_exc, IndexError) except Exception as exc: self.assertIsInstance(exc, IndexError) else: self.fail("Expected IndexError, but no exception was raised") try: with ExitStack() as stack: stack.callback(raise_exc, KeyError) stack.push(suppress_exc) stack.callback(raise_exc, IndexError) except Exception as exc: self.assertIsInstance(exc, KeyError) else: self.fail("Expected KeyError, but no exception was raised") def test_body_exception_suppress(self): def suppress_exc(*exc_details): return True try: with ExitStack() as stack: stack.push(suppress_exc) 1/0 except IndexError as exc: self.fail("Expected no exception, got IndexError") def test_exit_exception_chaining_suppress(self): with ExitStack() as stack: stack.push(lambda *exc: True) stack.push(lambda *exc: 1/0) stack.push(lambda *exc: {}[1]) def test_excessive_nesting(self): # The original implementation would die with RecursionError here with ExitStack() as stack: for i in range(10000): stack.callback(int) def test_instance_bypass(self): class Example(object): pass cm = Example() cm.__exit__ = object() stack = ExitStack() self.assertRaises(AttributeError, stack.enter_context, cm) stack.push(cm) self.assertIs(stack._exit_callbacks[-1], cm) # This is needed to make the test actually run under regrtest.py! def test_main(): support.run_unittest(__name__) if __name__ == "__main__": test_main() ' href='#n336'>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
<!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.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>HDF5: Link Access Properties</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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="hdf5doxy.css" rel="stylesheet" type="text/css">
<!-- <link href="hdf5doxy.css" rel="stylesheet" type="text/css"/>
 -->
<script type="text/javascript" src="hdf5_navtree_hacks.js"></script>
</head>
<body>
<div style="background:#FFDDDD;font-size:120%;text-align:center;margin:0;padding:5px">Please, help us to better serve our user community by answering the following short survey:  <a href="https://www.hdfgroup.org/website-survey/">https://www.hdfgroup.org/website-survey/</a></div>
<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 id="projectlogo"><img alt="Logo" src="HDFG-logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname"><a href="https://www.hdfgroup.org">HDF5</a>
   &#160;<span id="projectnumber">1.15.0</span>
   </div>
   <div id="projectbrief">API Reference</div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.svg"
               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.svg" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('group___l_a_p_l.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</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="#groups">Modules</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Link Access Properties<div class="ingroups"><a class="el" href="group___h5_p.html">Property Lists (H5P)</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p><a class="anchor" id="table_lapl_id"></a>
<table class="doxtable">
<caption border="1" style="background-color:whitesmoke;">Link access property list functions (H5P)</caption>
<tr>
<th>Function </th><th>Purpose  </th></tr>
<tr>
<td><a class="el" href="group___l_a_p_l.html#ga8850042eed51777866d7bd0d050cfdc2" title="Sets the external link traversal callback function in a link access property list.">H5Pset_elink_cb</a>/<a class="el" href="group___l_a_p_l.html#gacbf576bd8f7e63f3a91134b12d6b2d12" title="Retrieves the external link traversal callback function from the specified link access property list.">H5Pget_elink_cb</a> </td><td>Sets/gets the external link traversal callback function.  </td></tr>
<tr>
<td><a class="el" href="group___l_a_p_l.html#ga020f7eb2eae01043286af50db0a76d82" title="Sets the external link traversal file access flag in a link access property list.">H5Pset_elink_acc_flags</a>/<a class="el" href="group___l_a_p_l.html#gaf1357eb0940f171efecae06a9ed6155b" title="Retrieves the external link traversal file access flag from the specified link access property list.">H5Pget_elink_acc_flags</a> </td><td>Sets/gets the external link traversal file access flag.  </td></tr>
<tr>
<td><a class="el" href="group___l_a_p_l.html#ga3895e8e60ce8f0b6f32ab7a22c715d1a" title="Sets a file access property list for use in accessing a file pointed to by an external link.">H5Pset_elink_fapl</a>/<a class="el" href="group___l_a_p_l.html#ga2c2fe0a0396b9a0a02b28402e4ee108a" title="Retrieves the file access property list identifier associated with the link access property list.">H5Pget_elink_fapl</a> </td><td>Sets/gets a file access property list for use in accessing a file pointed to by an external link  </td></tr>
<tr>
<td><a class="el" href="group___l_a_p_l.html#gafa5eced13ba3a00cdd65669626dc7294" title="Sets prefix to be applied to external link paths.">H5Pset_elink_prefix</a>/<a class="el" href="group___l_a_p_l.html#ga7960f746797bcf35f70746cd644f8b5a" title="Retrieves prefix applied to external link paths.">H5Pget_elink_prefix</a> </td><td>Sets/gets prefix to be applied to external link paths.  </td></tr>
<tr>
<td><a class="el" href="group___l_a_p_l.html#gaa46c63c196a0cf5cd94dede039c030f4" title="Sets maximum number of soft or user-defined link traversals.">H5Pset_nlinks</a>/<a class="el" href="group___l_a_p_l.html#ga6bfa33fa9a77011cbdc06d0fbc907177" title="Retrieves the maximum number of link traversals.">H5Pget_nlinks</a> </td><td>Sets/gets maximum number of soft or user-defined link traversals.  </td></tr>
</table>
</p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="closed.png" alt="+"/> Collaboration diagram for Link Access Properties:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="group___l_a_p_l.png" border="0" usemap="#agroup______l__a__p__l" alt=""/></div>
<map name="agroup______l__a__p__l" id="agroup______l__a__p__l">
<area shape="rect" href="group___g_a_p_l.html" title=" " alt="" coords="431,5,611,31"/>
<area shape="rect" href="group___h5_p.html" title=" " alt="" coords="5,55,156,80"/>
<area shape="rect" title=" " alt="" coords="204,55,372,80"/>
<area shape="rect" href="group___t_a_p_l.html" title=" " alt="" coords="420,55,621,80"/>
<area shape="rect" href="group___d_a_p_l.html" title=" " alt="" coords="425,104,617,129"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
<tr class="memitem:group___d_a_p_l"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___d_a_p_l.html">Dataset Access Properties</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group___t_a_p_l"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___t_a_p_l.html">Datatype Access Properties</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group___g_a_p_l"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___g_a_p_l.html">Group Access Properties</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</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:gaf1357eb0940f171efecae06a9ed6155b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_a_p_l.html#gaf1357eb0940f171efecae06a9ed6155b">H5Pget_elink_acc_flags</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> lapl_id, unsigned *flags)</td></tr>
<tr class="memdesc:gaf1357eb0940f171efecae06a9ed6155b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the external link traversal file access flag from the specified link access property list.  <a href="group___l_a_p_l.html#gaf1357eb0940f171efecae06a9ed6155b">More...</a><br /></td></tr>
<tr class="separator:gaf1357eb0940f171efecae06a9ed6155b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacbf576bd8f7e63f3a91134b12d6b2d12"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_a_p_l.html#gacbf576bd8f7e63f3a91134b12d6b2d12">H5Pget_elink_cb</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> lapl_id, <a class="el" href="_h5_lpublic_8h.html#a96345937d04b66a13baec1ef1a6cff76">H5L_elink_traverse_t</a> *func, void **op_data)</td></tr>
<tr class="memdesc:gacbf576bd8f7e63f3a91134b12d6b2d12"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the external link traversal callback function from the specified link access property list.  <a href="group___l_a_p_l.html#gacbf576bd8f7e63f3a91134b12d6b2d12">More...</a><br /></td></tr>
<tr class="separator:gacbf576bd8f7e63f3a91134b12d6b2d12"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2c2fe0a0396b9a0a02b28402e4ee108a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_a_p_l.html#ga2c2fe0a0396b9a0a02b28402e4ee108a">H5Pget_elink_fapl</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> lapl_id)</td></tr>
<tr class="memdesc:ga2c2fe0a0396b9a0a02b28402e4ee108a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the file access property list identifier associated with the link access property list.  <a href="group___l_a_p_l.html#ga2c2fe0a0396b9a0a02b28402e4ee108a">More...</a><br /></td></tr>
<tr class="separator:ga2c2fe0a0396b9a0a02b28402e4ee108a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7960f746797bcf35f70746cd644f8b5a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5public_8h.html#af629ed855824cf5955b54529adf78ad6">ssize_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_a_p_l.html#ga7960f746797bcf35f70746cd644f8b5a">H5Pget_elink_prefix</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> plist_id, char *prefix, size_t size)</td></tr>
<tr class="memdesc:ga7960f746797bcf35f70746cd644f8b5a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves prefix applied to external link paths.  <a href="group___l_a_p_l.html#ga7960f746797bcf35f70746cd644f8b5a">More...</a><br /></td></tr>
<tr class="separator:ga7960f746797bcf35f70746cd644f8b5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6bfa33fa9a77011cbdc06d0fbc907177"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_a_p_l.html#ga6bfa33fa9a77011cbdc06d0fbc907177">H5Pget_nlinks</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> plist_id, size_t *nlinks)</td></tr>
<tr class="memdesc:ga6bfa33fa9a77011cbdc06d0fbc907177"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves the maximum number of link traversals.  <a href="group___l_a_p_l.html#ga6bfa33fa9a77011cbdc06d0fbc907177">More...</a><br /></td></tr>
<tr class="separator:ga6bfa33fa9a77011cbdc06d0fbc907177"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga020f7eb2eae01043286af50db0a76d82"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_a_p_l.html#ga020f7eb2eae01043286af50db0a76d82">H5Pset_elink_acc_flags</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> lapl_id, unsigned flags)</td></tr>
<tr class="memdesc:ga020f7eb2eae01043286af50db0a76d82"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the external link traversal file access flag in a link access property list.  <a href="group___l_a_p_l.html#ga020f7eb2eae01043286af50db0a76d82">More...</a><br /></td></tr>
<tr class="separator:ga020f7eb2eae01043286af50db0a76d82"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8850042eed51777866d7bd0d050cfdc2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_a_p_l.html#ga8850042eed51777866d7bd0d050cfdc2">H5Pset_elink_cb</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> lapl_id, <a class="el" href="_h5_lpublic_8h.html#a96345937d04b66a13baec1ef1a6cff76">H5L_elink_traverse_t</a> func, void *op_data)</td></tr>
<tr class="memdesc:ga8850042eed51777866d7bd0d050cfdc2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the external link traversal callback function in a link access property list.  <a href="group___l_a_p_l.html#ga8850042eed51777866d7bd0d050cfdc2">More...</a><br /></td></tr>
<tr class="separator:ga8850042eed51777866d7bd0d050cfdc2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3895e8e60ce8f0b6f32ab7a22c715d1a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_a_p_l.html#ga3895e8e60ce8f0b6f32ab7a22c715d1a">H5Pset_elink_fapl</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> lapl_id, <a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> fapl_id)</td></tr>
<tr class="memdesc:ga3895e8e60ce8f0b6f32ab7a22c715d1a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets a file access property list for use in accessing a file pointed to by an external link.  <a href="group___l_a_p_l.html#ga3895e8e60ce8f0b6f32ab7a22c715d1a">More...</a><br /></td></tr>
<tr class="separator:ga3895e8e60ce8f0b6f32ab7a22c715d1a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafa5eced13ba3a00cdd65669626dc7294"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_a_p_l.html#gafa5eced13ba3a00cdd65669626dc7294">H5Pset_elink_prefix</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> plist_id, const char *prefix)</td></tr>
<tr class="memdesc:gafa5eced13ba3a00cdd65669626dc7294"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets prefix to be applied to external link paths.  <a href="group___l_a_p_l.html#gafa5eced13ba3a00cdd65669626dc7294">More...</a><br /></td></tr>
<tr class="separator:gafa5eced13ba3a00cdd65669626dc7294"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaa46c63c196a0cf5cd94dede039c030f4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___l_a_p_l.html#gaa46c63c196a0cf5cd94dede039c030f4">H5Pset_nlinks</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> plist_id, size_t nlinks)</td></tr>
<tr class="memdesc:gaa46c63c196a0cf5cd94dede039c030f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets maximum number of soft or user-defined link traversals.  <a href="group___l_a_p_l.html#gaa46c63c196a0cf5cd94dede039c030f4">More...</a><br /></td></tr>
<tr class="separator:gaa46c63c196a0cf5cd94dede039c030f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaf1357eb0940f171efecae06a9ed6155b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf1357eb0940f171efecae06a9ed6155b">&#9670;&nbsp;</a></span>H5Pget_elink_acc_flags()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5Pget_elink_acc_flags </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>&#160;</td>
          <td class="paramname"><em>lapl_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned *&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves the external link traversal file access flag from the specified link access property list. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lapl_id</td><td>Link access property list identifier </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">flags</td><td>File access flag for link traversal</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.</dd></dl>
<p><a class="el" href="group___l_a_p_l.html#gaf1357eb0940f171efecae06a9ed6155b" title="Retrieves the external link traversal file access flag from the specified link access property list.">H5Pget_elink_acc_flags()</a> retrieves the file access flag used to open an external link target file from the specified link access property list.</p>
<p>Valid values for <code>flags</code> include: </p><ul>
<li><a class="el" href="_h5_fpublic_8h.html#a402673dec5c537b27a49a9a8bd6140b4">H5F_ACC_RDWR</a> - Files opened through external links will be opened with write access </li>
<li><a class="el" href="_h5_fpublic_8h.html#a1c406ffa89f4acf5a332144a2683d394">H5F_ACC_RDONLY</a> - Files opened through external links will be opened with read-only access </li>
<li><a class="el" href="_h5_fpublic_8h.html#ab0ce75eb6c23c77bf2736d53e2ea5dce">H5F_ACC_DEFAULT</a> - Files opened through external links will be opened with the same access flag as the parent file</li>
</ul>
<p>The value returned, if it is not <a class="el" href="_h5_fpublic_8h.html#ab0ce75eb6c23c77bf2736d53e2ea5dce">H5F_ACC_DEFAULT</a>, will override the default access flag, which is the access flag used to open the parent file.</p>
<p><b>Example Usage:</b> The following code retrieves the external link access flag settings on the link access property list <code>lapl_id</code> into a local variable: </p><pre>
        unsigned acc_flags;
        status = H5Pget_elink_acc_flags(lapl_id, &amp;acc_flags);
      </pre><dl class="section since"><dt>Since</dt><dd>1.8.3 </dd></dl>

</div>
</div>
<a id="gacbf576bd8f7e63f3a91134b12d6b2d12"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacbf576bd8f7e63f3a91134b12d6b2d12">&#9670;&nbsp;</a></span>H5Pget_elink_cb()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5Pget_elink_cb </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>&#160;</td>
          <td class="paramname"><em>lapl_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="_h5_lpublic_8h.html#a96345937d04b66a13baec1ef1a6cff76">H5L_elink_traverse_t</a> *&#160;</td>
          <td class="paramname"><em>func</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void **&#160;</td>
          <td class="paramname"><em>op_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves the external link traversal callback function from the specified link access property list. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lapl_id</td><td>Link access property list identifier </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">func</td><td>User-defined external link traversal callback function </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">op_data</td><td>User-defined input data for the callback function</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.</dd></dl>
<p><a class="el" href="group___l_a_p_l.html#gacbf576bd8f7e63f3a91134b12d6b2d12" title="Retrieves the external link traversal callback function from the specified link access property list.">H5Pget_elink_cb()</a> retrieves the user-defined external link traversal callback function defined in the specified link access property list.</p>
<p>The callback function may adjust the file access property list and file access flag to use when opening a file through an external link. The callback will be executed by the HDF5 library immediately before opening the target file.</p>
<p><b>Failure Modes:</b> <a class="el" href="group___l_a_p_l.html#gacbf576bd8f7e63f3a91134b12d6b2d12" title="Retrieves the external link traversal callback function from the specified link access property list.">H5Pget_elink_cb()</a> will fail if the link access property list identifier, <code>lapl_id</code>, is invalid.</p>
<p>An invalid function pointer or data pointer, <code>func</code> or <code>op_data</code> respectively, may cause a segmentation fault or an invalid memory access.</p>
<p><b>Example Usage:</b> The following code retrieves the external link callback settings on the link access property list <code>lapl_id</code> into local variables: </p><pre>
      H5L_elink_traverse_t elink_callback_func;
      void *elink_callback_udata;
      status = H5Pget_elink_cb (lapl_id, &amp;elink_callback_func,
                                &amp;elink_callback_udata);
      </pre><dl class="section since"><dt>Since</dt><dd>1.8.3 </dd></dl>

</div>
</div>
<a id="ga2c2fe0a0396b9a0a02b28402e4ee108a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2c2fe0a0396b9a0a02b28402e4ee108a">&#9670;&nbsp;</a></span>H5Pget_elink_fapl()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> H5Pget_elink_fapl </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>&#160;</td>
          <td class="paramname"><em>lapl_id</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves the file access property list identifier associated with the link access property list. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">lapl_id</td><td>Link access property list identifier</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a file access property list identifier if successful; otherwise returns <a class="el" href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a>.</dd></dl>
<p><a class="el" href="group___l_a_p_l.html#ga2c2fe0a0396b9a0a02b28402e4ee108a" title="Retrieves the file access property list identifier associated with the link access property list.">H5Pget_elink_fapl()</a> retrieves the file access property list identifier that is set for the link access property list identifier, <code>lapl_id</code>. The library uses this file access property list identifier to open the target file for the external link access. When no such identifier is set, this routine returns <a class="el" href="_h5_ppublic_8h.html#afa85e97bfbf9bf1c58e39263846c568f">H5P_DEFAULT</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group___l_a_p_l.html#ga3895e8e60ce8f0b6f32ab7a22c715d1a" title="Sets a file access property list for use in accessing a file pointed to by an external link.">H5Pset_elink_fapl()</a> and <a class="el" href="group___h5_l.html#ga15dfaeb9b1c0b3136533cb97ee45e683" title="Creates an external link, a soft link to an object in a different file.">H5Lcreate_external()</a>.</dd></dl>
<dl class="section since"><dt>Since</dt><dd>1.8.0 </dd></dl>

</div>
</div>
<a id="ga7960f746797bcf35f70746cd644f8b5a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7960f746797bcf35f70746cd644f8b5a">&#9670;&nbsp;</a></span>H5Pget_elink_prefix()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_h5public_8h.html#af629ed855824cf5955b54529adf78ad6">ssize_t</a> H5Pget_elink_prefix </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>&#160;</td>
          <td class="paramname"><em>plist_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>prefix</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves prefix applied to external link paths. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">plist_id</td><td>Link access property list identifier </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">prefix</td><td>Prefix applied to external link paths </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>Size of prefix, including null terminator</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>If successful, returns a non-negative value specifying the size in bytes of the prefix without the NULL terminator; otherwise returns a negative value.</dd></dl>
<p><a class="el" href="group___l_a_p_l.html#ga7960f746797bcf35f70746cd644f8b5a" title="Retrieves prefix applied to external link paths.">H5Pget_elink_prefix()</a> retrieves the prefix applied to the path of any external links traversed.</p>
<p>When an external link is traversed, the prefix is retrieved from the link access property list <code>plist_id</code>, returned in the user-allocated buffer pointed to by <code>prefix</code>, and prepended to the filename stored in the external link.</p>
<p>The size in bytes of the prefix, including the NULL terminator, is specified in <code>size</code>. If size is unknown, a preliminary <a class="el" href="group___l_a_p_l.html#ga7960f746797bcf35f70746cd644f8b5a" title="Retrieves prefix applied to external link paths.">H5Pget_elink_prefix()</a> call with the pointer <code>prefix</code> set to NULL will return the size of the prefix without the NULL terminator.</p>
<dl class="section since"><dt>Since</dt><dd>1.8.0 </dd></dl>

</div>
</div>
<a id="ga6bfa33fa9a77011cbdc06d0fbc907177"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6bfa33fa9a77011cbdc06d0fbc907177">&#9670;&nbsp;</a></span>H5Pget_nlinks()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5Pget_nlinks </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>&#160;</td>
          <td class="paramname"><em>plist_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t *&#160;</td>
          <td class="paramname"><em>nlinks</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves the maximum number of link traversals. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">plist_id</td><td>Link access property list identifier </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">nlinks</td><td>Maximum number of links to traverse</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative value if successful; otherwise, returns a negative value.</dd></dl>
<p><a class="el" href="group___l_a_p_l.html#ga6bfa33fa9a77011cbdc06d0fbc907177" title="Retrieves the maximum number of link traversals.">H5Pget_nlinks()</a> retrieves the maximum number of soft or user-defined link traversals allowed, <code>nlinks</code>, before the library assumes it has found a cycle and aborts the traversal. This value is retrieved from the link access property list <code>plist_id</code>.</p>
<p>The limit on the number of soft or user-defined link traversals is designed to terminate link traversal if one or more links form a cycle. User control is provided because some files may have legitimate paths formed of large numbers of soft or user-defined links. This property can be used to allow traversal of as many links as desired.</p>
<dl class="section since"><dt>Since</dt><dd>1.8.0 </dd></dl>

</div>
</div>
<a id="ga020f7eb2eae01043286af50db0a76d82"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga020f7eb2eae01043286af50db0a76d82">&#9670;&nbsp;</a></span>H5Pset_elink_acc_flags()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_h5public_8h.html#a3b079ecf932a5c599499cf7e298af160">herr_t</a> H5Pset_elink_acc_flags </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>&#160;</td>
          <td class="paramname"><em>lapl_id</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned&#160;</td>
          <td class="paramname"><em>flags</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the external link traversal file access flag in a link access property list. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">