[libvirt] [libvirt-php] docs: fixed uninitial private function name

Michal Novotny minovotn at redhat.com
Fri Feb 25 09:08:18 UTC 2011


On 02/25/2011 07:23 AM, Lyre wrote:
> * tools/generate-api-docs.c: add initialize for private function names
> ---
>   tools/generate-api-docs.c |   13 +++++++++----
>   1 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/tools/generate-api-docs.c b/tools/generate-api-docs.c
> index 322f3ef..8a16e22 100644
> --- a/tools/generate-api-docs.c
> +++ b/tools/generate-api-docs.c
> @@ -43,10 +43,15 @@ void parse_comment(char *line, int func_num, int *arg_num)
>   	if (strncmp(ltrimmed, "Function name:", 14) == 0) {
>   		functions[func_num].name = strdup( ltrim_string( ltrimmed + 14) );
>   	}
> -        else
> -        if (strncmp(ltrimmed, "Description:", 12) == 0) {
> -                functions[func_num].desc = strdup( ltrim_string( ltrimmed + 12) );
> -        }
> +	else
> +	if (strncmp(ltrimmed, "Private function name:", 22) == 0)
> +	{
> +		functions[func_num].name = NULL;
> +	}
> +	else
> +	if (strncmp(ltrimmed, "Description:", 12) == 0) {
> +	        functions[func_num].desc = strdup( ltrim_string( ltrimmed + 12) );
> +	}
>   	else
>   	if (strncmp(ltrimmed, "Arguments:", 10) == 0) {
>   		char *str = ltrim_string(ltrimmed + 11);
Thanks for your patch Lyre but I've already chosen and implemented 
another way of doing this to set the private flag in the func_t 
structure. Please see commit 851039c8. My approach could be useful to 
generate some internal (private) API guide that could be used to 
generate a libvirt-php bindings developer guide page if we decide to 
have it one day.

In fact what do you think about this? Is it good to have such a guide 
one day ? I think it could be however not for just 3 private functions. 
I guess there will be more private functions one day.

Thanks,
Michal

-- 
Michal Novotny<minovotn at redhat.com>, RHCE
Virtualization Team (xen userspace), Red Hat




More information about the libvir-list mailing list