On Sat, Feb 24, 2007 at 08:50:12AM -0500, Robert P. J. Day wrote: > > for those with a copy of LDD3, i'm looking at the example of using a > seq_file interface for the book's "scull" example, and i'm a bit > puzzled by how the iterator is being used. > > as i read it, the routines defined for that interface are constantly > being *told* where the current location is -- the scull_seq_next(), > rather than acting as a true iterator, accepts as input the position > from which to calculate and returns the next position. What do you mean by "a true iterator" ?. As far as I know, those methods (start, next, show) are never called manually. > wouldn't it make more sense to bury the current location (position) > in the example itself? so i'd just have to say things like "next" and > "show" without constantly passing pointers and positions? after all, > the whole idea of an iterator-based object is that *i* shouldn't have > to keep track of stuff like that. Again, They aren't made to call them manually. They're fed to another layer which uses it to read large proc files. -- Ahmed S. Darwish http://darwish.07.googlepages.com -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ