ldns(3) Library Functions Manual ldns(3)

# [NAME](#NAME)

ldns\_rdf\_new, ldns\_rdf\_clone, ldns\_rdf\_new\_frm\_data, ldns\_rdf\_new\_frm\_str, ldns\_rdf\_new\_frm\_fp, ldns\_rdf\_free, ldns\_rdf\_deep\_free, ldns\_rdf\_print - ldns\_rdf creation, destruction and printing

# [SYNOPSIS](#SYNOPSIS)

#include &lt;stdint.h&gt;  
#include &lt;stdbool.h&gt;

#include &lt;ldns/ldns.h&gt;

ldns\_rdf* ldns\_rdf\_new(ldns\_rdf\_type type, size\_t size, void \*data);

ldns\_rdf* ldns\_rdf\_clone(const ldns\_rdf \*rd);

ldns\_rdf* ldns\_rdf\_new\_frm\_data(ldns\_rdf\_type type, size\_t size, const void \*data);

ldns\_rdf* ldns\_rdf\_new\_frm\_str(ldns\_rdf\_type type, const char \*str);

ldns\_status ldns\_rdf\_new\_frm\_fp(ldns\_rdf \*\*r, ldns\_rdf\_type type, FILE \*fp);

void ldns\_rdf\_free(ldns\_rdf \*rd);

void ldns\_rdf\_deep\_free(ldns\_rdf \*rd);

void ldns\_rdf\_print(FILE \*output, const ldns\_rdf \*rdf);

# [DESCRIPTION](#DESCRIPTION)

*ldns\_rdf\_new*() allocates a new rdf structure and fills it. This function DOES NOT copy the contents from the buffer, unlike ldns\_rdf\_new\_frm\_data()  
**type**: type of the rdf  
**size**: size of the buffer  
**data**: pointer to the buffer to be copied  
Returns the new rdf structure or NULL on failure

*ldns\_rdf\_clone*() clones a rdf structure. The data is copied.  
**rd**: rdf to be copied  
Returns a new rdf structure

*ldns\_rdf\_new\_frm\_data*() allocates a new rdf structure and fills it. This function \_does_ copy the contents from the buffer, unlike ldns\_rdf\_new()  
**type**: type of the rdf  
**size**: size of the buffer  
**data**: pointer to the buffer to be copied  
Returns the new rdf structure or NULL on failure

*ldns\_rdf\_new\_frm\_str*() creates a new rdf from a string.  
**type**: type to use  
**str**: string to use  
Returns ldns\_rdf* or NULL in case of an error

*ldns\_rdf\_new\_frm\_fp*() creates a new rdf from a file containing a string.  
**r**: the new rdf  
**type**: type to use  
**fp**: the file pointer to use  
Returns LDNS\_STATUS\_OK or the error

*ldns\_rdf\_free*() frees a rdf structure, leaving the data pointer intact.  
**rd**: the pointer to be freed  
Returns void

*ldns\_rdf\_deep\_free*() frees a rdf structure \_and_ frees the data. rdf should be created with \_new\_frm\_data  
**rd**: the rdf structure to be freed  
Returns void

*ldns\_rdf\_print*() Prints the data in the rdata field to the given file stream (in presentation format)

**output**: the file stream to print to  
**rdf**: the rdata field to print  
Returns void

# [AUTHOR](#AUTHOR)

The ldns team at NLnet Labs.

# [REPORTING BUGS](#REPORTING_BUGS)

Please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues

# [COPYRIGHT](#COPYRIGHT)

Copyright (c) 2004 - 2006 NLnet Labs.

Licensed under the BSD License. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

# [SEE ALSO](#SEE_ALSO)

*ldns\_rdf*. And **perldoc Net::DNS**, **RFC1034**, **RFC1035**, **RFC4033**, **RFC4034** and **RFC4035**.

# [REMARKS](#REMARKS)

This manpage was automatically generated from the ldns source code.

30 May 2006

---

Document: ldns_rdf_deep_free(3) from ldns 1.9.2-r2 (Chainguard OS)
Source: https://github.com/NLnetLabs/ldns.git
