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

Giulio Camuffo giuliocamuffo at gmail.com
Fri Aug 26 09:12:59 UTC 2016


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

>  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


More information about the wayland-devel mailing list