On Wed, Aug 1, 2012 at 9:14 AM, Lionel Cons <lionelcons1...@googlemail.com> wrote: > On 1 August 2012 03:49, Roland Mainz <roland.ma...@nrubsig.org> wrote: [snip] >> Changes since the last version: >> - The API has been changed in an incompatible way. Previously all >> POLL*-flags were stuffed together in a single string variable (e.g. >> "events" and "revents"). This has been replaced with individual >> variables (making "events" and "revents" compound variables) which >> have the values 'true' or 'false'. > > I LOVE your poll - but was the API change really necessary? We now > face the task of updating a few hundred scripts...
Yes... IMO the change was neccesary since the old API made it mandatory to use shell patterns (e.g. $ [[ "${pl[foo].revents}" == *POLLIN* ]] # ... this is unavoidable since POLLHUP/POLLERR/POLLNVAL can always be set by the poll(2) call, regardless whether they were requested or not) ... which means we had to use the full might of the libast pattern matching engine to test each entry. The new API reduces this (usually) to a |strcmp(str, "true")|. This is more or less the difference between hunting for ducks with a shotgun vs. hunting the ducks with a S-300VM "Antey-2500" anti-ballistic missle system. Both options work... but guess which one is the more resource-saving method. > PS: Are you planning more incompatible API changes in poll? Nope... unless Glenn||David suggest more changes... ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) roland.ma...@nrubsig.org \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;) _______________________________________________ ast-developers mailing list ast-developers@research.att.com https://mailman.research.att.com/mailman/listinfo/ast-developers