VistaIOList(3)
π VistaIOList(3) π
okay so bestie, welcome to the Library Functions Manual page for VistaIOList β aka the glow-up your C code needs when you're juggling a whole squad of pointers and you want them in a specific order. π¦
β¨ NAME β¨
VistaIOList β representation of a list of opaque items π
πΈ SYNOPSIS πΈ
#include <vistaio.h>
VistaIOList vlist;
VistaIOList VistaIOListCreate (void);
int VistaIOListCount (VistaIOList vlist);
VistaIOPointer VistaIOListFirst (VistaIOList vlist);
VistaIOPointer VistaIOListLast (VistaIOList vlist);
VistaIOPointer VistaIOListNext (VistaIOList vlist);
VistaIOPointer VistaIOListPrev (VistaIOList vlist);
VistaIOPointer VistaIOListCurr (VistaIOList vlist);
void VistaIOListAdd (VistaIOList vlist, VistaIOPointer item);
void VistaIOListInsert (VistaIOList vlist, VistaIOPointer item);
void VistaIOListAppend (VistaIOList vlist, VistaIOPointer item);
void VistaIOListPrepend (VistaIOList vlist, VistaIOPointer item);
VistaIOPointer VistaIOListRemove (VistaIOList vlist);
void VistaIOListConcat (VistaIOList vlist1, VistaIOList vlist2);
void VistaIOListDestroy (VistaIOList vlist, void (*item_free)());
VistaIOPointer VistaIOListTrim (VistaIOList vlist);
VistaIOPointer VistaIOListSearch (VistaIOList vlist, int (*comp)(), VistaIOPointer comp_arg);
VistaIOPointer VistaIOListGetCurr (VistaIOList vlist);
void VistaIOListSetCurr (VistaIOList vlist, VistaIOPointer curr);
π«Ά DESCRIPTION π«Ά
π§ Introduction
The VistaIOList data type and its little friend-group of routines let you, a programmer, create and manipulate lists of opaque items. A VistaIOList is an ordered list whose elements are pointers to opaque data structures. No cap. β¨
The elements of a VistaIOList are arranged in a sequential order, so it's actually meaningful to say one element is before (or after) another element. And here's the iconic part β a VistaIOList has two pseudo-elements: BEFORE-ALL and AFTER-ALL. π
BEFORE-ALLsits before every other element of the list. The element beforeBEFORE-ALL? StillBEFORE-ALLitself. The element afterBEFORE-ALLis the first element of the list β orAFTER-ALLif the list is empty.AFTER-ALLsits after every other element of the list. The element afterAFTER-ALL? StillAFTER-ALLitself. The element beforeAFTER-ALLis the last element of the list β orBEFORE-ALLif the list is empty.
A VistaIOList also has the notion of a current item. The current item may be a particular element of the list, or the pseudo-element BEFORE-ALL, or the pseudo-element AFTER-ALL. And the value of the current item is simply the value of the element it represents β or NULL if it's the pseudo-element BEFORE-ALL or AFTER-ALL. π (yes, both of those give you NULL, it's giving "no thoughts, head empty")
π Routines and Macros
VistaIOListCreateβ creates an emptyVistaIOList, makesBEFORE-ALLthe current item, and returns the newVistaIOList. Baby's first list. πVistaIOListCountβ returns the number of elements invlist.VistaIOListFirstβ makes the first element ofvlistthe current item ifvlistis not empty, and makesBEFORE-ALLthe current item otherwise. It returns the value of the new current item.VistaIOListLastβ makes the last element ofvlistthe current item ifvlistis not empty, and makesAFTER-ALLthe current item otherwise. It returns the value of the new current item.VistaIOListNextβ makes the element after the current item ofvlistthe new current item, and returns the value of the new current item.VistaIOListPrevβ makes the element before the current item ofvlistthe new current item, and returns the value of the new current item.VistaIOListCurrβ returns the value of the current item ofvlist.VistaIOListAddβ addsitemtovlistimmediately after the current item, if the current item is notAFTER-ALL. Otherwise,itemis added tovlistimmediately beforeAFTER-ALL.VistaIOListAddmakesitemthe new current item.VistaIOListInsertβ addsitemtovlistimmediately before the current item, if the current item is notBEFORE-ALL. Otherwise,itemis added tovlistimmediately afterBEFORE-ALL.VistaIOListInsertmakesitemthe new current item.VistaIOListAppendβ addsitemtovlistimmediately beforeAFTER-ALL, and makesitemthe new current item.VistaIOListPrependβ addsitemtovlistimmediately afterBEFORE-ALL, and makesitemthe new current item.VistaIOListRemoveβ returnsNULLif the current item ofvlistis eitherBEFORE-ALLorAFTER-ALL. Otherwise,VistaIOListRemoveremoves the current item fromvlist, returns the value of the element being removed, and makes the element after the original current item the new current item.VistaIOListConcatβ concatenatesvlist2to the end ofvlist1. If the current item ofvlist1isAFTER-ALL, thenVistaIOListConcatwill make the element afterBEFORE-ALLofvlist2the current item of the concatenated list; otherwise, the current item ofvlist1will become the current item of the concatenated list. The concatenated list will be stored invlist1, andvlist2will cease to exist after the concatenation. π rip vlist2, you served.VistaIOListDestroyβ frees all the storage area occupied byvlist, including the storage area occupied by the opaque data objects pointed to by the elements ofvlist.item_freeis a pointer to a function that knows how to free an opaque data object.item_freemust have the following prototype:
void item_free (VistaIOPointer opaque_object)
where opaque_object is the object to be freed.
VistaIOListTrimβ removes the last element ofvlist, returns the value of the element being removed, and makes the new last element the current item (by callingVistaIOListLast) ifvlistis not empty. Otherwise,VistaIOListTrimmakesAFTER-ALLthe current item and returnsNULL.VistaIOListSearchβ searches for the first occurrence (starting from the current item) of an elementeinvlistsuch that a call to(*comp)(e, comp_arg)returns a non-zero value. If such an element exists,VistaIOListSearchmakes that element the current item and returns the value of that element. Otherwise,VistaIOListSearchmakesAFTER-ALLthe current item and returnsNULL. it's giving detective era πVistaIOListGetCurrβ returns an opaque pointer denoting the current item. This pointer is only intended for use in a subsequent invocation ofVistaIOListSetCurr.VistaIOListSetCurrβ sets the identity of the current item using a value previously supplied byVistaIOListGetCurr.
β οΈ Care must be taken to ensure that this isn't an item that has been removed from the list since VistaIOListGetCurr was used. fr fr, do NOT skip this one, that's a one-way ticket to undefined-behaviour city π
π₯ SEE ALSO π₯
nothing here bestie β this section is literally empty in the original, no references listed, no crumbs left behind π
π AUTHOR π
- Daniel Ko
<ko@cs.ubc.ca> - Adaption to vistaio: Gert Wollny
<gw.fossdev@gmail.com>
and that's the whole page!! ty for reading, you ate that π β¨
VistaIO Version 1.2.14 πΈ 3 June 1994 β yes it's vintage, yes it still slays, VistaIOList(3) out π«Άπ
π¦ where this page comes from
- debian bookworm: libvistaio-dev 1.2.19-3 Β· libvista-orig
- debian trixie: libvistaio-dev 1.2.19-3+b2 Β· libvista-orig
- ubuntu jammy: libvistaio-dev 1.2.19-3 Β· libvista-orig
- ubuntu noble: libvistaio-dev 1.2.19-3 Β· libvista-orig
- ubuntu questing: libvistaio-dev 1.2.19-4
- ubuntu resolute: libvistaio-dev 1.2.19-4build1 Β· libvista-orig
- ubuntu stonking: libvistaio-dev 1.2.19-4build1 Β· libvista-orig
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms