Commit 445b33ef authored by Jan Včelák's avatar Jan Včelák 🚀

dname: new API to create dname from C string

parent 2670053b
......@@ -360,6 +360,17 @@ knot_dname_t *knot_dname_from_str(const char *name, unsigned len)
/*----------------------------------------------------------------------------*/
knot_dname_t *knot_dname_from_cstr(const char *name)
{
if (!name) {
return NULL;
}
return knot_dname_from_str(name, strlen(name));
}
/*----------------------------------------------------------------------------*/
int knot_dname_to_lower(knot_dname_t *name)
{
if (name == NULL)
......
......@@ -143,6 +143,15 @@ char *knot_dname_to_str(const knot_dname_t *name);
*/
knot_dname_t *knot_dname_from_str(const char *name, unsigned len);
/*!
* \brief Create a dname structure from domain name given as a C string.
*
* \param name DNAME in presentation format as a C string.
*
* \return New name or NULL.
*/
knot_dname_t *knot_dname_from_cstr(const char *name);
/*!
* \brief Convert name to lowercase.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment