modprobe and lists

Yann E. MORIN yann.morin.1998 at anciens.enib.fr
Fri May 19 12:57:56 UTC 2006


On Friday 19 May 2006 141, Bernhard Fischer wrote:
> On Fri, May 19, 2006 at 01:35:02PM +0200, Yann E. MORIN wrote:
> >modprobe is making use of lists, both single- and double-linked lists.
> >Currently, modprobe is implementing is own list management, when we have
> >(at least) single-linked list management in libbb.
> >1) Would it be desireable that libbb implements both lists?
> I tend to think having both in libbb is worthwhile.

OK, I'll (try to) do it.

> Apart from modprobe, which other applet(s) need doubly-linked lists?

No idea... :-/

> >2) "llist" stands for "linked list". Should we add reverse link to that type
> >   or create "dllist" (standing fo "doubly-linked list") ?

> What about
> Index: include/libbb.h
> ===================================================================
> --- include/libbb.h	(revision 15121)
> +++ include/libbb.h	(working copy)
> @@ -473,7 +473,10 @@
>  
>  typedef struct llist_s {
>  	char *data;
> -	struct llist_s *link;
> +	struct llist_s *next;
> +#ifdef __NEED_DLLIST
> +	struct llist_s *prev;
> +#endif
>  } llist_t;
>  extern llist_t *llist_add_to(llist_t *old_head, char *new_item);
>  extern llist_t *llist_add_to_end(llist_t *list_head, char *data);

OK, I'll try something like that, with a config option in the menu:
  Busybox Settings -> Busybox Library Tuning -> Support doubly linked lists

CONFIG_DLLIST will:
  - default to 'n'
  - be visible only is CONFIG_BUILD_LIBBUSYBOX is set
  - be select'ed by all applets that need it (for now CONFIG_MODPROBE)

Then enclose code with USE_DLLIST( ... ).

Regards,
Yann E. MORIN.

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |   ^                |
| --==< °_° >==-- °---.----------------:  X  AGAINST      |  /e\  There is no  |
| web: ymorin.free.fr | SETI at home 3808 | / \ HTML MAIL    |  """  conspiracy.  |
°---------------------°----------------°------------------°--------------------°




More information about the busybox mailing list