On Tue, 2011-05-24 at 17:28 +0200, Jiri Moskovcak wrote:
On 05/24/2011 01:53 PM, Denys Vlasenko wrote:
> On Tue, 2011-05-24 at 09:46 +0200, Jiri Moskovcak wrote:
>>> Somewhat unrelated note:
>>>
>>> I have a feeling than function named just "report" is bound to
cause
>>> name collisions. Not in Python, but in C, where there are no namespaces
>>> to guard against that. Consider that our own code _already_
>>> has such collision! src/cli/report.{c,h} has
>>> int report(const char *dump_dir_name, int flags)!
>>>
>>> We need different name...
>>>
>>
>> - how about report_problem() ?
>
> Good!
>
>> - but I would still like to keep at least the python compat version
>> (which we can mark as obsolete and push people to use the new name in
>> new code)
>
>
> Of course. My point is, Python version of compat layer is better than C
> implementation of it, because in Python it is simpler and, more
> importantly, it doesn't interfere with wrappers, it builds on top of
> them. Keeping wrappers simple enough so that we will understand in two
> months what they do is already no too easy :)
>
> I propose the following patches. Basically:
>
> Change include/report/report.h so that it contains
> LIBREPORT_foo consts;
> int report_problem_in_dir(const char *dirname, int flags);
> int report_problem_in_memory(problem_data_t *pd, int flags);
> int report_problem(problem_data_t *pd);
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ as you proposed
> (this change is in 8.patch)
>
> Then, python wrappers are extended to expose entire
> include/report/report.h API.
> Also, README is added in python wrapper dir so that future hackers
> know what is where, and why.
> (this change is in 9.patch)
>
- seems ok, please push it to git
Thanks! Pushed.
--
vda