> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/btlv_8h.md).

# btlv.h

[Data Structures](#nested-classes) | [Macros](#define-members) | [Typedefs](#typedef-members) | [Enumerations](#enum-members) | [Functions](#func-members)

`#include "`[mem\_pool.h](/s-adk-5.1-programmers-guide/mem__pool_8h_source.md)`"`

Include dependency graph for btlv.h:

![](/files/PyoXW8UHV0H4L0MHcWp2)

This graph shows which files directly or indirectly include this file:

![](/files/FQtbu3J1rQeTg3wFnE3F)

[Go to the source code of this file.](/s-adk-5.1-programmers-guide/btlv_8h_source.md)

|                 |                                                                                  |
| --------------- | -------------------------------------------------------------------------------- |
| Data Structures |                                                                                  |
| struct          | [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) |

|         |                                                                                                                                      |
| ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| Macros  |                                                                                                                                      |
| #define | [TLV\_UTIL\_INTERFACE](#ae809ada9194252356dbaa46410dfbb39)                                                                           |
| #define | [MAX\_TAGSIZE](#a50b52ae3c35fc20556babf890cfac1e8)   3                                                                               |
| #define | [BTLVTagBufSize](#af6af4054a4c0b2b6aa3af16ad0a59262)   9                                                                             |
| #define | [ULTAG2ASC](#a5ac8dbc13c1b366634608e665414cb0b)(ulTag)   [pcBTLVTagStr2](#a898c1c73324c3f1b98dadc47e1d3d8ca)(ulTag,\_ULTAG2ASC\_BUF) |
| #define | [ULTAG2ASCBUF](#ab33e2864700c667b7fab74ab32e1f661)   [BTLVTagBufType](#a57d6632fcc401eae0143b396bc37f610) \_ULTAG2ASC\_BUF;          |

|              |                                                                                                             |
| ------------ | ----------------------------------------------------------------------------------------------------------- |
| Typedefs     |                                                                                                             |
| typedef char | [BTLVTagBufType](#a57d6632fcc401eae0143b396bc37f610)\[[BTLVTagBufSize](#af6af4054a4c0b2b6aa3af16ad0a59262)] |

|              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Enumerations |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| enum         | <p>{<br>  <a href="#adf764cbdea00d65edcd07bb9953ad2b7a8b1b8e2a4bd05998a61ed69992a18db8">CONTEXT\_CLASS</a> =0x80, <a href="#adf764cbdea00d65edcd07bb9953ad2b7a5f6e319a5eb9707d04a8955d9ba84b2d">PRIVATE\_CLASS</a> =0xC0, <a href="#adf764cbdea00d65edcd07bb9953ad2b7a175c9159bc44eb41d367c6f1bc91c6f0">CONSTRUCTET\_TAG</a> =0x20, <a href="#adf764cbdea00d65edcd07bb9953ad2b7aa6555b39404374518c52c9f1d4b287cf">CONSTRUCTED\_TAG</a> =0x20,<br>  <a href="#adf764cbdea00d65edcd07bb9953ad2b7ac55c03a8fda74e99b525713117c28871">PRIMITIVE\_TAG</a> =0x00<br>}</p>                                                                                                                                                                                                                                                                                                                                                                                                               |
| enum         | <p><a href="#a7e2d1907ba985dee09f6663cce879c58">BTLV\_ERROR</a> {<br>  <a href="#a7e2d1907ba985dee09f6663cce879c58ab53077a5cd8bc50b231c04553e5ac97b">BTLV\_ERR\_INVALID</a> =-1, <a href="#a7e2d1907ba985dee09f6663cce879c58afd2d74e17ce837ffe98816c0e724665c">BTLV\_ERR\_BUFFER</a> =-2, <a href="#a7e2d1907ba985dee09f6663cce879c58a9d176f568ac26baa1822807703e39740">BTLV\_ERR\_MEMORY</a> =-3, <a href="#a7e2d1907ba985dee09f6663cce879c58a17c7ff08d171600533cc70ed7af4a7b2">BTLV\_ERR\_FILE</a> =-4,<br>  <a href="#a7e2d1907ba985dee09f6663cce879c58ad6ba5273ebac2b6f0af83185288e9dd2">BTLV\_ERR\_NOT\_FOUND</a> =-5, <a href="#a7e2d1907ba985dee09f6663cce879c58ae4cafe8ec6a55dddce06c8bef4bfad8b">BTLV\_ERR\_CONSTRUCTED</a> =-6, <a href="#a7e2d1907ba985dee09f6663cce879c58a43a54deda383d1e35f540f493309ca42">BTLV\_ERR\_DONE\_FILTER</a> =-7, <a href="#a7e2d1907ba985dee09f6663cce879c58ad922de81b82504919cc59f94e84eff63">BTLV\_ERR\_ABORT\_FILTER</a> =-8<br>}</p> |
| enum         | [BTLVFilter](#aa47b9ee960be926bcd97dddca1c30029) { [BTLV\_FLTR\_KEEP](#aa47b9ee960be926bcd97dddca1c30029a9250de9dbb34e118938b8e0d5e664f9c) =0, [BTLV\_FLTR\_DONE](#aa47b9ee960be926bcd97dddca1c30029a5711695a0bb77f606ef391b7d66c7ecb) =-1, [BTLV\_FLTR\_REMOVE](#aa47b9ee960be926bcd97dddca1c30029ac9c5cd9b5f377cb0fd163e48efb26db8) =-2, [BTLV\_FLTR\_ABORT](#aa47b9ee960be926bcd97dddca1c30029a09e440cadf77ed22c9a3da990666100b) =-3 }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| enum         | [BTLVContext](#a03946fb744cc22a5454713443cbfd3ac) { [BTLV\_IMPORT\_START](#a03946fb744cc22a5454713443cbfd3aca8fab1c50c71f0f46dfdaf6ce4d4677bd), [BTLV\_IMPORT\_DONE](#a03946fb744cc22a5454713443cbfd3aca9343874b0dcc419155af849b42f0b184) }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| enum         | [BTLVMatch](#afebb9e8dd2052cbbb5f4287ade3ed4a1) { [BTLV\_MISMATCH](#afebb9e8dd2052cbbb5f4287ade3ed4a1a3aaffa1128ac43539538bb379aacedf4), [BTLV\_MATCH](#afebb9e8dd2052cbbb5f4287ade3ed4a1a9940bdcc624f2ff3ee4a429b9146cce7), [BTLV\_CHILDMATCH](#afebb9e8dd2052cbbb5f4287ade3ed4a1a503f2757551d14a8dd66e04a0169bd4d), [BTLV\_PARENTMATCH](#afebb9e8dd2052cbbb5f4287ade3ed4a1a1e184691119c4b9324f7c112e3a35ad1) }                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |

|                                                                                                                                                                                                                                                                                                                                                                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Functions                                                                                                                                                                                                                                                                                                                                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void                                                                                       | [vBTLVInit](#af6c59b296fd3283b94548f090f171844) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxNode, struct [MemoryPool](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#struct_memory_pool) \*pxMempool)                                |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \* | [pxBTLVAppendTag](#a0c33e9a258ab58a2ad1662ab7ab8e60d) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxRoot, const char \*pcPath, const unsigned char \*pucData, unsigned uSize)                                                                                                                                                                                                                         |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \* | [pxBTLVWriteTag](#a9819b6c9e4d8be3c412cf251e564d31d) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxRoot, const char \*pcPath, const unsigned char \*pucData, unsigned uSize)                                                                                                                                                                                                                          |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int                                                                                        | [iBTLVWriteData](#a4aa4b3d47babeb7783fecc723e404e21) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxNode, unsigned char \*pucData, unsigned uSize)                                                                                                                                                                                                                                                     |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \* | [pxBTLVFindTag](#ac74569eef6689e6b833ec7f9fe53e5ab) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxRoot, const char \*pcPath)                                                                                                                                                                                                                                                                          |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \* | [pxBTLVFindNextTag](#a977bdec574dab7f629a9044b39d14760) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxRoot, const char \*pcPath, struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxPrev)                                                                                                                                                                    |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void                                                                                       | [vBTLVClear](#ae064b0803b734441d055f6b1e3fa3e2b) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxNode)                                                                                                                                                                                                                                                                                                  |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void                                                                                       | [vBTLVRemoveNode](#aefad2bd854223903fd4ce35850c78a57) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxNode)                                                                                                                                                                                                                                                                                             |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void                                                                                       | [vBTLVMoveNode](#a33fd877746b3f147f99ba1046c22fe05) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxRoot, struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxNode)                                                                                                                                                                                             |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) unsigned                                                                                   | [uBTLVContentSize](#afe9285fc51ca05d0cb7a308d89b0e79f) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxRoot)                                                                                                                                                                                                                                                                                            |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int                                                                                        | [iBTLVExport](#ae2fe6355ed919824ce036153083febcb) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxRoot, unsigned char \*pucBuffer, unsigned uMaxSize)                                                                                                                                                                                                                                                   |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int                                                                                        | [iBTLVExportFile](#ad8678f771c3915f4f49e938e528c72bf) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxRoot, const char \*pcFilename)                                                                                                                                                                                                                                                                    |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int                                                                                        | [iBTLVAppendFile](#a6bcdff952c962b9ea166f7fbc474072c) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxRoot, const char \*pcFilename)                                                                                                                                                                                                                                                                    |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int                                                                                        | [iBTLVImport](#a1186828a015bfce0db9bf478349a7480) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxRoot, const unsigned char \*pucBuffer, unsigned uSize, enum [BTLVFilter](#aa47b9ee960be926bcd97dddca1c30029)(\*pxFilter)(void \*, struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*, enum [BTLVContext](#a03946fb744cc22a5454713443cbfd3ac)), void \*pvData) |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int                                                                                        | [iBTLVImportFile](#a75c2c0f386df0d159be41f49146c78ff) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxRoot, const char \*pcFilename, enum [BTLVFilter](#aa47b9ee960be926bcd97dddca1c30029)(\*pxFilter)(void \*, struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*, enum [BTLVContext](#a03946fb744cc22a5454713443cbfd3ac)), void \*pvData)                     |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int                                                                                        | [iBTLVExtractTag](#a9cc36410c15461fea9d73c7773bedda3) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxRoot, const char \*pcPath, unsigned char \*pucBuffer, unsigned uSize)                                                                                                                                                                                                                             |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) enum [BTLVMatch](#afebb9e8dd2052cbbb5f4287ade3ed4a1)                                       | [xBTLVMatchPath](#acf449e96c5391ef94ada65ae1a246909) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxRoot, const char \*pcPath)                                                                                                                                                                                                                                                                         |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int                                                                                        | [iBTLVGetPath](#a308f326bb12d98ba27901c8c7b337c3e) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxRoot, char \*pcBuffer, int iMaxsize)                                                                                                                                                                                                                                                                 |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) char \*                                                                                    | [pcBTLVTagStr2](#a898c1c73324c3f1b98dadc47e1d3d8ca) (unsigned long ulTag, [BTLVTagBufType](#a57d6632fcc401eae0143b396bc37f610) tcTagBuf)                                                                                                                                                                                                                                                                                                             |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) char \*                                                                                    | [pcBTLVTagStr](#a1b418cf187e4f149ea7caeeae687eca5) (unsigned long ulTag) \_\_attribute((deprecated))                                                                                                                                                                                                                                                                                                                                                 |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) unsigned long                                                                              | [ulBTLVTagNum](#ace353f55cd1d0a53a729184ed82ae418) (const char \*pcTag)                                                                                                                                                                                                                                                                                                                                                                              |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void                                                                                       | [vBTLVBuildTag](#a511e4f76699d656bdba14dced30bc3dd) (unsigned char ucbyte1, unsigned long tag\_number, char \*pcTag)                                                                                                                                                                                                                                                                                                                                 |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void                                                                                       | [vBTLVGetTagNumber](#a814714ea6ec61664cad4337db999242b) (unsigned char \*ucTag, unsigned long \*ptag\_number)                                                                                                                                                                                                                                                                                                                                        |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) unsigned long                                                                              | [ulBTLVGetTagNumber](#abb24425dcf4f8a780a014247b2dad8c7) (const char \*Tag)                                                                                                                                                                                                                                                                                                                                                                          |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \* | [pxBTLVGetChild](#a52cd9eb8cdb1868c6cba4d733f219a1d) (const struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxParent, int n)                                                                                                                                                                                                                                                                               |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int                                                                                        | [iBTLVGetChildOffset](#a9e8c58882510a966fa32b91a2ec8accb) (const struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxParent, const struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxChild)                                                                                                                                                                        |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int                                                                                        | [iBTLVGetChildCount](#add6f494e76f568567d9a9d346e8d7ba1) (const struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxParent)                                                                                                                                                                                                                                                                                  |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \* | [pxBTLVGetParent](#a09a6ac5853977837f126c5c9af05de77) (const struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxChild)                                                                                                                                                                                                                                                                                      |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void                                                                                       | [vBTLVWipeAndClear](#ad64bc62b62bf5375b2b4813f76ee8f26) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxNode) \_\_attribute((deprecated))                                                                                                                                                                                                                                                               |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void                                                                                       | [vBTLVWipeAndRemoveNode](#acadee218eb35d1eecce639c637496953) (struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md) \*pxNode) \_\_attribute((deprecated))                                                                                                                                                                                                                                                          |
| [TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void                                                                                       | [vBTLVSetWipeCallback](#aa6cb90004fb1fab00ac3afbc7a9493b3) (void(\*cb)(void \*, unsigned))                                                                                                                                                                                                                                                                                                                                                           |

### MacroDefinition Documentation <a href="#macro-definition-documentation" id="macro-definition-documentation"></a>

### BTLVTagBufSize <a href="#af6af4054a4c0b2b6aa3af16ad0a59262" id="af6af4054a4c0b2b6aa3af16ad0a59262"></a>

\#define BTLVTagBufSize   9

### MAX\_TAGSIZE <a href="#a50b52ae3c35fc20556babf890cfac1e8" id="a50b52ae3c35fc20556babf890cfac1e8"></a>

\#define MAX\_TAGSIZE   3

maximum size of the (binary) tag name in bytes constants for [vBTLVBuildTag()](#a511e4f76699d656bdba14dced30bc3dd):

### TLV\_UTIL\_INTERFACE <a href="#ae809ada9194252356dbaa46410dfbb39" id="ae809ada9194252356dbaa46410dfbb39"></a>

\#define TLV\_UTIL\_INTERFACE

### ULTAG2ASC <a href="#a5ac8dbc13c1b366634608e665414cb0b" id="a5ac8dbc13c1b366634608e665414cb0b"></a>

\#define ULTAG2ASC

### ULTAG2ASCBUF <a href="#ab33e2864700c667b7fab74ab32e1f661" id="ab33e2864700c667b7fab74ab32e1f661"></a>

\#define ULTAG2ASCBUF   \[BTLVTagBufType]\(#a57d6632fcc401eae0143b396bc37f610) \\\_ULTAG2ASC\_BUF;

### TypedefDocumentation <a href="#typedef-documentation" id="typedef-documentation"></a>

### BTLVTagBufType <a href="#a57d6632fcc401eae0143b396bc37f610" id="a57d6632fcc401eae0143b396bc37f610"></a>

typedef char BTLVTagBufType\\\[\[BTLVTagBufSize]\(#af6af4054a4c0b2b6aa3af16ad0a59262)\\]

### EnumerationType Documentation <a href="#enumeration-type-documentation" id="enumeration-type-documentation"></a>

### anonymousenum <a href="#adf764cbdea00d65edcd07bb9953ad2b7" id="adf764cbdea00d65edcd07bb9953ad2b7"></a>

anonymous enum

|                  |                                                                                  |
| ---------------- | -------------------------------------------------------------------------------- |
| Enumerator       |                                                                                  |
| CONTEXT\_CLASS   | context class (used for [vBTLVBuildTag()](#a511e4f76699d656bdba14dced30bc3dd))   |
| PRIVATE\_CLASS   | private class (used for [vBTLVBuildTag()](#a511e4f76699d656bdba14dced30bc3dd))   |
| CONSTRUCTET\_TAG |                                                                                  |
| CONSTRUCTED\_TAG | constructed tag (used for [vBTLVBuildTag()](#a511e4f76699d656bdba14dced30bc3dd)) |
| PRIMITIVE\_TAG   | primitive tag (used for [vBTLVBuildTag()](#a511e4f76699d656bdba14dced30bc3dd))   |

### BTLV\_ERROR <a href="#a7e2d1907ba985dee09f6663cce879c58" id="a7e2d1907ba985dee09f6663cce879c58"></a>

enum \[BTLV\_ERROR]\(#a7e2d1907ba985dee09f6663cce879c58)

|                          |                                                           |
| ------------------------ | --------------------------------------------------------- |
| Enumerator               |                                                           |
| BTLV\_ERR\_INVALID       | invalid data was found, e.g. invalid tag, length, ...     |
| BTLV\_ERR\_BUFFER        | buffer is too small                                       |
| BTLV\_ERR\_MEMORY        | failed to allocate memory                                 |
| BTLV\_ERR\_FILE          | failed to access/write file                               |
| BTLV\_ERR\_NOT\_FOUND    | the tag has not been found                                |
| BTLV\_ERR\_CONSTRUCTED   | tried to extract data from a constructed node             |
| BTLV\_ERR\_DONE\_FILTER  | the import filter has prematurely finished importing data |
| BTLV\_ERR\_ABORT\_FILTER | the import filter has aborted the import of data          |

### BTLVContext <a href="#a03946fb744cc22a5454713443cbfd3ac" id="a03946fb744cc22a5454713443cbfd3ac"></a>

enum \[BTLVContext]\(#a03946fb744cc22a5454713443cbfd3ac)

context in which the filter callback was called

|                     |                                                                     |
| ------------------- | ------------------------------------------------------------------- |
| Enumerator          |                                                                     |
| BTLV\_IMPORT\_START | the node is just to be imported, i.e. it is created but still empty |
| BTLV\_IMPORT\_DONE  | the node has been completely imported                               |

### BTLVFilter <a href="#aa47b9ee960be926bcd97dddca1c30029" id="aa47b9ee960be926bcd97dddca1c30029"></a>

enum \[BTLVFilter]\(#aa47b9ee960be926bcd97dddca1c30029)

result codes for filter callbacks

|                    |                                                                                                                                                                                |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Enumerator         |                                                                                                                                                                                |
| BTLV\_FLTR\_KEEP   | keep current node and continue                                                                                                                                                 |
| BTLV\_FLTR\_DONE   | keep current node and stop importing further nodes. When scanning files for information this can be used to stop reading the file when the desired information has been found. |
| BTLV\_FLTR\_REMOVE | remove current node and its children                                                                                                                                           |
| BTLV\_FLTR\_ABORT  | remove current node and stop importing further nodes                                                                                                                           |

### BTLVMatch <a href="#afebb9e8dd2052cbbb5f4287ade3ed4a1" id="afebb9e8dd2052cbbb5f4287ade3ed4a1"></a>

enum \[BTLVMatch]\(#afebb9e8dd2052cbbb5f4287ade3ed4a1)

result when matching paths to nodes

|                   |                                             |
| ----------------- | ------------------------------------------- |
| Enumerator        |                                             |
| BTLV\_MISMATCH    | the path to the node does not match         |
| BTLV\_MATCH       | the path to the node is a perfect match     |
| BTLV\_CHILDMATCH  | the node is a child of a matching path      |
| BTLV\_PARENTMATCH | the node may be a parent of a matching path |

### FunctionDocumentation <a href="#function-documentation" id="function-documentation"></a>

### iBTLVAppendFile() <a href="#a6bcdff952c962b9ea166f7fbc474072c" id="a6bcdff952c962b9ea166f7fbc474072c"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int iBTLVAppendFile

append data to the end of the file. Incomplete nodes at the end of the file (e.g. resulting from a power failure) are removed first. As long as the data to be written has only one node on the topmost level, this function is atomic: Either this node is written completely or it is removed when the next node is appended or ignored when the file is read.

**Parameters**

\[in] **pxRoot** root node; \[in] **pcFilename** file name

#### Returns

number of written bytes. If an error happens a negative value is returned:

\[unsupported block]

#### Date

12.3.2007

#### Author

M. Meixner

### iBTLVExport() <a href="#ae2fe6355ed919824ce036153083febcb" id="ae2fe6355ed919824ce036153083febcb"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int iBTLVExport

Write the data found in a tree to a buffer in BER-TLV format

**Parameters**

\[in] **pxRoot** root node \[out] **pucBuffer** destination buffer \[in] **uMaxSize** size of the destination buffer

#### Returns

number of written bytes. If an error happens a negative value is returned:

\[unsupported block]

#### Date

4.12.2006

#### Author

M. Meixner

### iBTLVExportFile() <a href="#ad8678f771c3915f4f49e938e528c72bf" id="ad8678f771c3915f4f49e938e528c72bf"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int iBTLVExportFile

Write the data found in a tree to a file in BER-TLV format. The data is first written to a temporary file (suffix ".TMP") and then renamed to the original file name. By this an error or power failue while writing the file does not corrupt any data.

**Parameters**

\[in] **pxRoot** root node \[in] **pcFilename** file name

#### Returns

number of written bytes. If an error happens a negative value is returned:

\[unsupported block]

#### Date

30.1.2007

#### Author

M. Meixner

### iBTLVExtractTag() <a href="#a9cc36410c15461fea9d73c7773bedda3" id="a9cc36410c15461fea9d73c7773bedda3"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int iBTLVExtractTag

extract data from a primitive node

**Parameters**

\[in] **pxRoot** root node \[in] **pcPath** path consisting of one or several tags separated by '/'. The tags are given as C-string (i.e. hex-dump of the tag), e.g. '20/DF01'. If a tag occurs several times, the path will descend into the first (left) subtree. (See also TLV Path names) \[out] **pucBuffer** destination buffer to which the result will be written \[in] **uSize** size of the buffer

#### Returns

number of written bytes. If an error happens a negative value is returned:

\[unsupported block]

If the tag was not found pucBuffer remains unmodified.

#### Date

5.12.2006

#### Author

M. Meixner

### iBTLVGetChildCount() <a href="#add6f494e76f568567d9a9d346e8d7ba1" id="add6f494e76f568567d9a9d346e8d7ba1"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int iBTLVGetChildCount

get number of child elements from parent

**Parameters**

\[in] **pxParent** parent node

#### Returns

number of children

### iBTLVGetChildOffset() <a href="#a9e8c58882510a966fa32b91a2ec8accb" id="a9e8c58882510a966fa32b91a2ec8accb"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int iBTLVGetChildOffset

get offset of child element

**Parameters**

\[in] **pxParent** parent node \[in] **pxChild** child node

#### Returns

child offset within parent (-1 on error)

### iBTLVGetPath() <a href="#a308f326bb12d98ba27901c8c7b337c3e" id="a308f326bb12d98ba27901c8c7b337c3e"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int iBTLVGetPath

extract the path from the root to the current node

**Parameters**

\[in] **pxRoot** current node \[out] **pcBuffer** buffer that is filled with the path \[in] **iMaxsize** size of pcBuffer in bytes

#### Returns

error code, 0 in case of success

#### Date

6.2.2007

#### Author

M. Meixner

### iBTLVImport() <a href="#a1186828a015bfce0db9bf478349a7480" id="a1186828a015bfce0db9bf478349a7480"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int iBTLVImport

read data from a buffer in BER-TLV format.

**Parameters**

\[out] **pxRoot** root node that will receive the input. If the node has child nodes these are released prior to reading the data. \[in] **pucBuffer** source buffer \[in] **uSize** size of the source buffer \[in] **pxFilter** import filter callback, see also: Import filter callback. The pointer may be set to 0 to disable filtering. \[in] **pvData** pointer to data that is passed on to the import filter, not used when no callback was given.

#### Returns

error code:

\[unsupported block]

#### Date

4.12.2006

#### Author

M. Meixner

### iBTLVImportFile() <a href="#a75c2c0f386df0d159be41f49146c78ff" id="a75c2c0f386df0d159be41f49146c78ff"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int iBTLVImportFile

read data from a file in BER-TLV format.

**Parameters**

\[out] **pxRoot** root node that will receive the input. If the node has child nodes these are released prior to reading the data. \[in] **pcFilename** name of the file \[in] **pxFilter** import filter callback, see also: Import filter callback. The pointer may be set to 0 to disable filtering. \[in] **pvData** pointer to data that is passed on to the import filter, not used when no callback was given.

#### Returns

number of bytes read. In case of an error a negative value is returned:

\[unsupported block]

When reading fails, pxRoot->uSize contains the number of bytes read without considering incomplete nodes.

#### Date

30.1.2007

#### Author

M. Meixner

### iBTLVWriteData() <a href="#a4aa4b3d47babeb7783fecc723e404e21" id="a4aa4b3d47babeb7783fecc723e404e21"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) int iBTLVWriteData

write data to a node

**Parameters**

\[in] **pxNode** node to which to write data \[in] **pucData** pointer to data to be stored into the tree. Note that only primitive nodes may contain data. \[in] **uSize** size of the data to be stored into the tree.

#### Returns

1 in case of success, else 0

#### Date

15.5.2007

#### Author

M. Meixner

### pcBTLVTagStr() <a href="#a1b418cf187e4f149ea7caeeae687eca5" id="a1b418cf187e4f149ea7caeeae687eca5"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) char\\\* pcBTLVTagStr

convert tag from number to string

**Parameters**

\[in] **ulTag** tag number

#### Returns

tag string

#### Date

04.02.2013

#### Author

T. Buening

[**Deprecated:**](/s-adk-5.1-programmers-guide/readme/deprecated.md#_deprecated000143) This function is not thread safe! It is strongly recommended to use pcBTLVTagStr2 or macro ULTAG2ASC

### pcBTLVTagStr2() <a href="#a898c1c73324c3f1b98dadc47e1d3d8ca" id="a898c1c73324c3f1b98dadc47e1d3d8ca"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) char\\\* pcBTLVTagStr2

convert tag from number to string with Buffer provided by caller

**Parameters**

\[in] **ulTag** tag number \[in] **tcTagBuf** pointer to Buffer (content will be modified)

#### Returns

tag string (pointer to tcTagBuf+offset)

#### Date

2014-04-17

#### Author

J. Weckmann

{% hint style="info" %}
this is for avoiding trouble if pcBTLVTagStr2 is called several times
{% endhint %}

### pxBTLVAppendTag() <a href="#a0c33e9a258ab58a2ad1662ab7ab8e60d" id="a0c33e9a258ab58a2ad1662ab7ab8e60d"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md)\\\* pxBTLVAppendTag

append a tag to the tree

**Parameters**

\[in,out] **pxRoot** root node of the tree \[in] **pcPath** path consisting of one or several tags separated by '/'. The tags are given as C-string (i.e. hex-dump of the tag), e.g. '20/DF01'. Intermediate nodes will be created as required. If a tag occurs several times, it will append the node in the tree where the best (longest) match was found. If this is not desired, pxBTLVFindTag() may be used to navigate to the desired node and use a path relative to this node to insert data. (See also TLV Path names) \[in] **pucData** pointer to data to be stored into the tree. Note that only primitive nodes may contain data. For constructed tags pucData is ignored and should be set to 0. For primitive nodes pucData may be set to 0 to just allocate the memory without initialization. The data may be inserted later using the pointer from the return value. \[in] **uSize** size of the data to be stored into the tree. For constructed nodes uSize is ignored and should be set to 0.

#### Returns

pointer to the newly allocated node.

#### Date

4.12.2006

#### Author

M. Meixner

### pxBTLVFindNextTag() <a href="#a977bdec574dab7f629a9044b39d14760" id="a977bdec574dab7f629a9044b39d14760"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md)\\\* pxBTLVFindNextTag

Search for the next tag of the same path in the tree. Within a tree nodes with the same name may occur several times. pxBTLVFindTag only finds the first match. [pxBTLVFindNextTag()](#a977bdec574dab7f629a9044b39d14760) allows to search for other nodes with the same path name.

**Parameters**

\[in,out] **pxRoot** root node of the tree \[in] **pcPath** path consisting of one or several tags separated by '/'. The tags are given as C-string (i.e. hex-dump of the tag), e.g. '20/DF01'. If a tag occurs several times, the path will descend into the first (left) subtree. The member pxNext may be used to access successive (right) siblings of this node. (See also TLV Path names) \[in] **pxPrev** previous node in the tree. If set to 0 pxBTLVFindNextTag is the same as pxBTLVFindTag.

#### Returns

pointer to the found node or 0.

#### Date

4.12.2006

#### Author

M. Meixner

### pxBTLVFindTag() <a href="#ac74569eef6689e6b833ec7f9fe53e5ab" id="ac74569eef6689e6b833ec7f9fe53e5ab"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md)\\\* pxBTLVFindTag

Search for a tag in the tree

**Parameters**

\[in,out] **pxRoot** root node of the tree \[in] **pcPath** path consisting of one or several tags separated by '/'. The tags are given as C-string (i.e. hex-dump of the tag), e.g. '20/DF01'. If a tag occurs several times, the path will descend into the first (left) subtree. The member pxNext may be used to access successive (right) siblings of this node. (See also TLV Path names)

#### Returns

pointer to the found node or 0.

#### Date

4.12.2006

#### Author

M. Meixner

### pxBTLVGetChild() <a href="#a52cd9eb8cdb1868c6cba4d733f219a1d" id="a52cd9eb8cdb1868c6cba4d733f219a1d"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md)\\\* pxBTLVGetChild

get nth. child element from parent

**Parameters**

\[in] **pxParent** parent node \[in] **n** child element index (starting with zero)

#### Returns

pointer to the found node or 0.

### pxBTLVGetParent() <a href="#a09a6ac5853977837f126c5c9af05de77" id="a09a6ac5853977837f126c5c9af05de77"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md)\\\* pxBTLVGetParent

get parent of a child

**Parameters**

\[in] **pxChild** child node

#### Returns

pointer to the found parent node or 0.

### pxBTLVWriteTag() <a href="#a9819b6c9e4d8be3c412cf251e564d31d" id="a9819b6c9e4d8be3c412cf251e564d31d"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) struct [BTLVNode](/s-adk-5.1-programmers-guide/readme/annotated/struct_b_t_l_v_node.md)\\\* pxBTLVWriteTag

Write a tag in the tree. If the tag already exists it gets overwritten. If it does not yet exist, it is appended.

**Parameters**

\[in,out] **pxRoot** root node of the tree \[in] **pcPath** path consisting of one or several tags separated by '/'. (see pxBTLVAppendTag()) (See also TLV Path names) \[in] **pucData** pointer to data to be stored into the tree. Note that only primitive nodes may contain data. For constructed tags pucData is ignored and should be set to 0. For primitive nodes pucData may be set to 0 to just allocate the memory without initialization. The data may be inserted later using the pointer from the return value. \[in] **uSize** size of the data to be stored into the tree. For constructed nodes uSize is ignored and should be set to 0.

#### Returns

pointer to the newly allocated node.

#### Date

4.12.2006

#### Author

M. Meixner

### uBTLVContentSize() <a href="#afe9285fc51ca05d0cb7a308d89b0e79f" id="afe9285fc51ca05d0cb7a308d89b0e79f"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) unsigned uBTLVContentSize

calculate the size that will be required to export the tree into a flat, BER-TLV encoded buffer. As a side effect the uSize entry in the nodes is updated.

**Parameters**

\[in,out] **pxRoot** node to be removed

#### Date

4.12.2006

#### Author

M. Meixner

### ulBTLVGetTagNumber() <a href="#abb24425dcf4f8a780a014247b2dad8c7" id="abb24425dcf4f8a780a014247b2dad8c7"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) unsigned long ulBTLVGetTagNumber

recover reference number from tag name

**Parameters**

\[in] **Tag** buffer with tag name (ASCII string)

#### Returns

tag number

#### Date

13.04.2010

#### Author

A. Groennert

### ulBTLVTagNum() <a href="#ace353f55cd1d0a53a729184ed82ae418" id="ace353f55cd1d0a53a729184ed82ae418"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) unsigned long ulBTLVTagNum

convert tag from string to number

**Parameters**

\[in] **pcTag** tag string

#### Returns

tag number

#### Date

10.12.2014

#### Author

T. Buening

### vBTLVBuildTag() <a href="#a511e4f76699d656bdba14dced30bc3dd" id="a511e4f76699d656bdba14dced30bc3dd"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void vBTLVBuildTag

build tag name from given number

**Parameters**

\[in] **ucbyte1** tag type definition, e.g. (PRIVATE\_CLASS | PRIMITIVE\_TAG), or (CONTEXT\_CLASS | CONSTRUCTET\_TAG) \[in] **tag\_number** reference number to build the tag \[out] **pcTag** buffer where to put the tag name (ASCII string)

#### Date

13.04.2010

#### Author

A. Groennert

\[unsupported block]

### vBTLVClear() <a href="#ae064b0803b734441d055f6b1e3fa3e2b" id="ae064b0803b734441d055f6b1e3fa3e2b"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void vBTLVClear

Remove the content of a node including child nodes, the node itself is not released. The node stays initialized, i.e. it is not required to call [vBTLVInit()](#af6c59b296fd3283b94548f090f171844) after [vBTLVClear()](#ae064b0803b734441d055f6b1e3fa3e2b).

**Parameters**

\[in,out] **pxNode** node to be removed

#### Date

2.4.2007

#### Author

M. Meixner

### vBTLVGetTagNumber() <a href="#a814714ea6ec61664cad4337db999242b" id="a814714ea6ec61664cad4337db999242b"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void vBTLVGetTagNumber

recover reference number from tag name

**Parameters**

\[in] **ucTag** buffer with tag name (ASCII string) \[out] **ptag\_number** buffer where to put the reference number

#### Date

13.04.2010

#### Author

A. Groennert

### vBTLVInit() <a href="#af6c59b296fd3283b94548f090f171844" id="af6c59b296fd3283b94548f090f171844"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void vBTLVInit

Initialize the root node of the tree. The root node of the tree may reside on the stack or in the global data segment. If nodes have been created in the tree the memory allocated for them must be released using [vBTLVClear()](#ae064b0803b734441d055f6b1e3fa3e2b) when done.

**Parameters**

\[in] **pxNode** pointer to the root node \[in] **pxMempool** memory pool from which memory is allocated for the child nodes and data or null pointer to allocate memory from the heap

#### Date

4.12.2006

#### Author

M. Meixner

{% hint style="info" %}
When using vBTLVInit on already initialized nodes, a memory leak may result.
{% endhint %}

### vBTLVMoveNode() <a href="#a33fd877746b3f147f99ba1046c22fe05" id="a33fd877746b3f147f99ba1046c22fe05"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void vBTLVMoveNode

Move a node including subnodes from one tree to another. The node is appended as a child to the supplied node. This function must not be called for root nodes. NOTE: Don't allocate child nodes with malloc on your own. Instead always use [pxBTLVAppendTag()](#a0c33e9a258ab58a2ad1662ab7ab8e60d).

**Parameters**

\[in,out] **pxRoot** node to which the subtree is appended \[in] **pxNode** node that is moved to another tree

#### Date

18.2.2009

#### Author

M. Meixner

### vBTLVRemoveNode() <a href="#aefad2bd854223903fd4ce35850c78a57" id="aefad2bd854223903fd4ce35850c78a57"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void vBTLVRemoveNode

Remove a node from the tree and release the memory allocated for this node. This function must not be called for root nodes that were allocated on the stack, use [vBTLVClear()](#ae064b0803b734441d055f6b1e3fa3e2b) in this case.

**Parameters**

\[in,out] **pxNode** node to be removed

#### Date

4.12.2006

#### Author

M. Meixner

### vBTLVSetWipeCallback() <a href="#aa6cb90004fb1fab00ac3afbc7a9493b3" id="aa6cb90004fb1fab00ac3afbc7a9493b3"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void vBTLVSetWipeCallback

Set a function, which wipes data of BTLV notes before the memory is released. After setting the wipe function the user needs no longer care about the wipe of sensitive data in BTLV buffers with special functions [vBTLVWipeAndClear()](#ad64bc62b62bf5375b2b4813f76ee8f26) and [vBTLVWipeAndRemoveNode()](#acadee218eb35d1eecce639c637496953), since this will be handled implicitely, if BTLV nodes are removed (e.g. with the normal use of [vBTLVClear()](#ae064b0803b734441d055f6b1e3fa3e2b)).

**Parameters**

**cb** callback function, which is invoked to overwrite BTLV data, before the memory for this data is released. The function is passed a pointer and the size of the memory, so that the wipe function might simply memset() to overwrite the old BTLV data.

{% hint style="info" %}
This function is not thread-safe, therefore, it is recommended to invoke it as one of the very first functions in [main()](/s-adk-5.1-programmers-guide/readme/files/dir_44d926a17fc606d3c25449ba60427c63/dir_048f823fee1bfb22502a8732b9a001aa/main_8cpp.md#a0ddf1224851353fc92bfbff6f499fa97), before any BTLV functions are used.
{% endhint %}

### vBTLVWipeAndClear() <a href="#ad64bc62b62bf5375b2b4813f76ee8f26" id="ad64bc62b62bf5375b2b4813f76ee8f26"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void vBTLVWipeAndClear

Wipe data and remove the content of a node including child nodes, the node itself is not released. The node stays initialized, i.e. it is not required to call [vBTLVInit()](#af6c59b296fd3283b94548f090f171844) after [vBTLVWipeAndClear()](#ad64bc62b62bf5375b2b4813f76ee8f26).

**Parameters**

\[in,out] **pxNode** node to be removed

#### Date

05.09.2018

#### Author

J. Zaragoza

[**Deprecated:**](/s-adk-5.1-programmers-guide/readme/deprecated.md#_deprecated000144) [vBTLVWipeAndClear()](#ad64bc62b62bf5375b2b4813f76ee8f26) does not consider BTLV data, which was overwritten by [pxBTLVWriteTag()](#a9819b6c9e4d8be3c412cf251e564d31d), therefore, it is recommended to use [vBTLVSetWipeCallback()](#aa6cb90004fb1fab00ac3afbc7a9493b3) instead.

### vBTLVWipeAndRemoveNode() <a href="#acadee218eb35d1eecce639c637496953" id="acadee218eb35d1eecce639c637496953"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) void vBTLVWipeAndRemoveNode

Wipe data and remove a node including child nodes and release the memory allocated for this node and its child nodes. This function must not be called for root nodes that were allocated on the stack, use [vBTLVWipeAndClear()](#ad64bc62b62bf5375b2b4813f76ee8f26) in this case.

**Parameters**

\[in,out] **pxNode** node to be removed

#### Date

05.09.2018

#### Author

J. Zaragoza

[**Deprecated:**](/s-adk-5.1-programmers-guide/readme/deprecated.md#_deprecated000145) [vBTLVWipeAndRemoveNode()](#acadee218eb35d1eecce639c637496953) does not consider BTLV data, which was overwritten by [pxBTLVWriteTag()](#a9819b6c9e4d8be3c412cf251e564d31d), therefore, it is recommended to use [vBTLVSetWipeCallback()](#aa6cb90004fb1fab00ac3afbc7a9493b3) instead.

### xBTLVMatchPath() <a href="#acf449e96c5391ef94ada65ae1a246909" id="acf449e96c5391ef94ada65ae1a246909"></a>

[TLV\_UTIL\_INTERFACE](/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/mem__pool_8h.md#ae809ada9194252356dbaa46410dfbb39) enum \[BTLVMatch]\(#afebb9e8dd2052cbbb5f4287ade3ed4a1) xBTLVMatchPath

match a node against a path.

**Parameters**

\[in] **pxRoot** node \[in] **pcPath** path consisting of one or several tags separated by '/'. (See also TLV Path names)

#### Returns

one of:

\[unsupported block]

#### Date

6.2.2007

#### Author

M. Meixner


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/s-adk-5.1-programmers-guide/readme/files/dir_f2a776acea245b054b8e462971041f2d/dir_a10348dacfa670aa644c1e595a24cf25/dir_2b94011182cccbeeedaa27d80210d4e6/dir_811fc19cda6e4229a2bc03f90d55dff0/btlv_8h.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
