XMLISTGETMATCHPOS(3)

πŸ“¦
version 2.5.2 Β· 2 versions
, in alpine 3.24, arch rolling, centos-stream 9, epel 10, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0

✨ NAME ✨

XmListGetMatchPos β€” a List function that returns all instances of an item in the list πŸ’– (it's from the library call manual, bestie, we're in the library section, iykyk)


🌸 SYNOPSIS 🌸

#include <Xm/List.h>
Boolean XmListGetMatchPos(
Widget widget,
XmString item,
int **position_list,
int *position_count);

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so XmListGetMatchPos is a Boolean function that hands you back an array of positions where a specified item is found in a List. Like, you're looking for one thing and it's telling you everywhere that thing is living. Obsessed. πŸ‘‘

Here's the tea on the args:

  • widget β€” the ID of the List widget. that's your girl, that's who you're interrogating πŸ’…
  • item β€” the item you're searching for. the one, the moment, the main character ✨
  • position_list β€” returns an array of positions at which the item occurs in the List. And listen, the counting starts at 1 for the first item, 2 for the second item, and so on forever and ever. When the return value is True, XmListGetMatchPos allocates memory for this array β€” and the caller is responsible for freeing this memory. 😭 Yes bestie, you. The caller can recover the allocated memory by calling XtFree.
  • position_count β€” returns the number of elements in the position_list. just how many matches we found, bestie πŸŽ€
lowkey important: for a complete definition of List and its associated resources, go see XmList(3). no cap, that's where the lore lives.

πŸ’– RETURN πŸ’–

Returns True if the specified item is present in the list, and False if it is not. that's it, that's the vibe check 🫢



and that's the whole page, bestie β€” this was XmListGetMatchPos(library call), coming to you straight from the library call manual 🧚 go forth, free your XtFree memory, and slay βœ¨πŸ’œ