[PATCH wayland 1/2] util: Document wl_list methods

Giulio Camuffo giuliocamuffo at gmail.com
Sun Aug 28 07:02:46 UTC 2016


Il 26/ago/2016 16:28, "Yong Bakos" <junk at humanoriented.com> ha scritto:
>
> On Aug 26, 2016, at 2:12 AM, Giulio Camuffo <giuliocamuffo at gmail.com>
wrote:
> >
> > Hi,
> >
> >
> >>
> >> +/**
> >> + * Removes an element from the list.
> >> + *
> >> + * \param elm element to remove from the list
> >> + */
> > I think this should mention that elm is left in an invalid state, and
> > the user should call wl_list_init on it before using it again.
> >
> > Cheers,
> > Giulio
>
> Thanks Giulio. Or, should wl_list_remove be modified to ensure that
> next and prev point to elm? (Either way, I'll add the details to
> the dox.)

This has been discussed in the past but there wasn't a consensus about
changing the behavior so I think it's best to just add a note in the docs.

Cheers,
Giulio

>
> yong
>
>
> >> void
> >> wl_list_remove(struct wl_list *elm);
> >>
> >> +/**
> >> + * Determines the length of the list.
> >> + *
> >> + * \note This is an O(n) operation.
> >> + *
> >> + * \param list list whose length is to be determined
> >> + *
> >> + * \return number of elements in the list
> >> + */
> >> int
> >> wl_list_length(const struct wl_list *list);
> >>
> >> +/**
> >> + * Determines if the list is empty.
> >> + *
> >> + * \param list list whose emptiness is to be determined
> >> + *
> >> + * \return 1 if empty, or 0 if not empty
> >> + */
> >> int
> >> wl_list_empty(const struct wl_list *list);
> >>
> >> +/**
> >> + * Inserts all of the elements of one list into another, after the
element
> >> + * represented by `list`.
> >> + *
> >> + * \param list list element after which the other list elements will
be inserted
> >> + * \param other list of elements to insert
> >> + *
> >> + */
> >> void
> >> wl_list_insert_list(struct wl_list *list, struct wl_list *other);
> >>
> >> --
> >> 2.7.2
> >>
> >> _______________________________________________
> >> wayland-devel mailing list
> >> wayland-devel at lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
> > _______________________________________________
> > wayland-devel mailing list
> > wayland-devel at lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20160828/3ed12b7d/attachment.html>


More information about the wayland-devel mailing list