seq_file's and iterators

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  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.

  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.

  thoughts?  is that just another way to use a seq_file?

rday

-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux