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

* 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); -- 1.7.1

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@redhat.com>, RHCE Virtualization Team (xen userspace), Red Hat

于 2011年02月25日 17:08, Michal Novotny 写道:
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
Got it. Before your patch, I encountered SIGSEGV on x86_64 platform, so I fixed it. I'm not sure your design and just try to make it work. I believe it is a good to mark up private or public APIs. Also, did you notice another patch from me yesterday? It modified many files, seems not a good practice. Next time, should I Cc the patch to you as well?

On 02/25/2011 11:00 AM, Lyre wrote:
于 2011年02月25日 17:08, Michal Novotny 写道:
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
Got it. Before your patch, I encountered SIGSEGV on x86_64 platform, so I fixed it. I'm not sure your design and just try to make it work.
I believe it is a good to mark up private or public APIs.
Also, did you notice another patch from me yesterday? It modified many files, seems not a good practice. Next time, should I Cc the patch to you as well?
Well, it's better to put me to Cc. Also, did you have a look whether the patch is committed to the Git repo or not? If not, could you please resend it privately just to my e-mail now? Thanks, Michal -- Michal Novotny<minovotn@redhat.com>, RHCE Virtualization Team (xen userspace), Red Hat

On 02/25/2011 02:34 PM, Lyre wrote:
Michal you may remvoe libvirt-php.spec form git, since it will be generated.
Ok, thanks for this Lyre. Please remove it with your next patch, right? Thanks, Michal -- Michal Novotny<minovotn@redhat.com>, RHCE Virtualization Team (xen userspace), Red Hat
participants (2)
-
Lyre
-
Michal Novotny