AuScanEvents(3)

πŸ“¦ version 1.9.5, in fedora 43, fedora 44

✨ AuScanEvents ✨

okay so bestie, this one's from the audiolib girlies β€” the Library Functions Manual β€” and it's literally just: gimme the first event that matches my vibe check. that's it. that's the function. πŸ’…


🌸 NAME 🌸

AuScanEvents β€” returns the first event that satisfies the predicate. no cap, that's the whole job description. πŸ”₯


πŸŽ€ SYNOPSIS πŸŽ€

#include <audio/audiolib.h>

AuBool AuScanEvents(server, mode, dequeue, predicate, arg, event)
    AuServer *server;
    int mode;
    AuBool dequeue;
    AuBool (*predicate)(AuServer *,AuEvent *, AuPointer);
    AuPointer arg;
    AuEvent *event; /* RETURN */

πŸ¦‹ ARGUMENTS πŸ¦‹

  • server β€” the connection to the audio server. your link to the whole situation, your main character's phone line fr. πŸ’–
  • mode β€” how far you're willing to go looking for a match. must be one of these constants: AuEventsQueuedAlready, AuEventsQueuedAfterReading, or AuEventsQueuedAfterFlush. pick your level of effort, queen. πŸ‘‘
  • dequeue β€” if a matching event gets found, do we remove it from the queue? yes or no, decide your boundaries. 🫢
  • predicate β€” the procedure that gets called to figure out if an event actually matches the criteria. this is your little judge, your vibe-checker, your "is this for me" oracle. ✨
  • arg β€” any extra arguments you wanna pass along to that predicate procedure. lil gift basket for the judge. 🎁
  • event β€” returns the matching event, if one was found. the moment of truth. 😭

πŸ’œ DESCRIPTION πŸ’œ

so AuScanEvents scans the event queue looking for the first event that satisfies the caller-supplied predicate. it's giving "scroll until you find the one". 🌈

  • If mode is AuEventsQueuedAlready, AuScanEvents only checks for events already in the queue. it's not getting up off the couch for you, bestie. πŸ’€
  • If mode is AuEventsQueuedAfterReading, and a matching event isn't found already in the queue, AuScanEvents attempts to read more events out of the application's connection. okay so now it's putting in a little effort. 🧚
  • If mode is AuEventsQueuedAfterFlush and a matching event isn't already in the queue or isn't waiting to be read, AuScanEvents flushes the output queue and attempts to read more events out of the application's connection. full send. highkey committed. πŸ”₯

If dequeue is AuTrue, and a matching event is found, it is removed from the queue. bye boo, you're coming with me. πŸ’…

The predicate procedure is called with the arguments server, event, and arg β€” and it should return AuTrue to indicate a match. return AuTrue = "yes this one, this is the one", periodt. ⭐


🌟 SEE ALSO 🌟

  • AuEventsQueued
  • AuScanForTypedEvent
  • AuNextEvent
  • audiolib β€” Network Audio System C Language Interface

real talk: this is your audiolib event handling content, version 1.9.5, brought to you by the AuScanEvents(3) section of the manual. go scan some events, you absolute icon. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ
πŸ“¦ where this page comes from