Summary: | passing lists with variadic sized types to requests looks complicated and error prone | ||
---|---|---|---|
Product: | XCB | Reporter: | Daniel Martin <consume.noise> |
Component: | Library | Assignee: | Daniel Martin <consume.noise> |
Status: | RESOLVED MOVED | QA Contact: | xcb mailing list dummy <xcb> |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Daniel Martin
2013-10-28 12:21:50 UTC
Hi Daniel, First thanks for making the bug easy to follow :) I can see the problem, the current interface is clearly not usable, and certainly unexpected. As for the solution, it's the only reasonable approach I can come up with as well. Instead of changing the function signature/abi, you might consider generating a '_serialize' function for this argument, which takes the array-of-structs as you proposed and puts out the serialized buffer, which you can then pass to e.g. xcb_set_font_path(). There's some precedent to these '_serialize' functions as you know (though only for entire requests AFAIK). A shortcoming of this is that you have to malloc() the returned buffer inside the serialize function, but xcb isn't repelled by malloc() anyway. However since no one's using these functions, I would personally prefer the direct-function-argument approach. But just something to consider. -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/lib/libxcb/issues/12. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.