On Thu, Jun 16, 2011 at 10:07 PM, Adam Stokes
<astokes(a)fedoraproject.org> wrote:
> +#ifndef __MH_DNSSRV_H__
> +#define __MH_DNSSRV_H__
> +
> +#define MAX_NAME_LEN 1024
> +
> +extern int srv_lookup(char *query, char *target);
Perhaps add a mh_ prefix to this function name?
Since query is an input param, you can make it const.
I would recommend a third parameter which is the buffer length for the
output parameter target. That way the function can ensure it doesn't
attempt to write beyond the bounds of target.
Some doxygen comments for the new API call would be cool, too. :-)
> + size = res_query(query, C_IN, T_SRV, (unsigned char*)&answer,
> sizeof(answer));
I think you can just use "answer.buf" instead of &answer here and then
avoid the need for a cast.
--
Russell Bryant
_______________________________________________
Matahari mailing list
Matahari(a)lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/matahari
--
__ __
.-----.| |_.-----.| |--.-----.-----.
|__ --|| _| _ || <| -__|__ --|
|_____||____|_____||__|__|_____|_____|
.----------------------------------.
( ajs(a)redhat.com || 919.754.4187 )
`----------------------------------'