QueryPackage(3z)

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

πŸ’– QueryPackage(3z) πŸ’–

okay bestie, welcome to the z88dk Programmer's Manual and today's main character is QueryPackage β€” she opens shared libraries/packages and she does it flawlessly. let's get into it πŸ¦‹


✨ NAME ✨

QueryPackage β€” open a shared library/package πŸ‘‘


✨ SYNOPSIS ✨

#include <z88.h>

bool_t QueryPackage(char package, char major , char minor);

like yes, that's the whole vibe. one include, one call. πŸŽ€


✨ DESCRIPTION ✨

so the QueryPackage() function does two things, and honestly? she ate.

  1. she checks the shared package package
  2. she makes it available for use β€” with a version of at least minor.minor

it's giving "let me verify you exist and then let you in the door" πŸ’…

here's the order of operations, no cap: the function initially checks for the presence of the package subsystem itself, and only then does she proceed to check for the specified package. two-step verification, very demure.

oh and if you don't care about version checking at all? just pass minor and major as 0 and version checking gets disabled. lowkey the easiest shortcut ever. ✨


✨ RETURN VALUE ✨

  • 0 = failure 😭
  • 1 = success πŸŽ‰

and here's the iconic part: the carry flag is set accordingly, which means you can use the non-standard iferror { ... } construct to check for success. iykyk. 🫢

not me reminding you that iferror is non-standard β€” it's a z88dk thing, bestie, don't try it at home (or in a different compiler).

🌈 SEE ALSO 🌈

(the original page doesn't list any SEE ALSO references, so there's nothing to cross-link here β€” go forth and QueryPackage responsibly) 🧚


k bye, ily, go write some slay code πŸ’œ

this has been your girl from the z88dk Programmer's Manual, dated 18 February 2000 β€” yes she's vintage, yes she still serves πŸ‘‘βœ¨πŸŒΈ

πŸ“¦ where this page comes from