ZMQ::FFI::Util(3pm)

πŸ“¦
version 1.19 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– ZMQ::FFI::Util πŸ’–

okay bestie so this is ZMQ::FFI::Util, a lil Perl module from the User Contributed Perl Documentation corner of the universe, and it's literally just a grab-bag of zmq convenience functions. that's it. that's the vibe. πŸ¦‹

version 1.19 β€” yes queen, we're on 1.19, iconic behavior ✨


🌸 SYNOPSIS 🌸

here's how you actually use it, no cap:

use ZMQ::FFI::Util q(zmq_soname zmq_version)

my $soname = zmq_soname();
my ($major, $minor, $patch) = zmq_version($soname);

look at that. two functions. one import. we're serving ✨minimalism✨ and honestly? obsessed.


πŸŽ€ FUNCTIONS πŸŽ€

πŸ’… zmq_soname([die => 0|1])

so this one is on a mission: it tries to load libzmq by looking for a platform-specific shared library file using FFI::CheckLib, with a fallback to Alien::ZMQ::latest. it's giving "i'll find your library, bestie, one way or another." πŸ”₯

it returns the name of the first one that was successful, or undef if nothing worked out. 😭

and if you're not the type to handle undef gracefully β€” like, if you'd rather things just blow up spectacularly β€” you can pass die => 1 and get exceptional behavior instead. dramatic. love that for you. πŸ’€

🧚 ($major, $minor, $patch) = zmq_version([$soname])

this one returns the libzmq version as the list ($major, $minor, $patch). three numbers. one list. slay. πŸ‘‘

about that $soname β€” it can be either:

  • a filename available in the ld cache, or
  • the path to a library file

if $soname is not specified, it gets resolved using zmq_soname (the one from above, yes, the little detective one πŸ”).

⚠️ and if $soname cannot be resolved, undef is returned. so like, check your values, bestie. don't come crying to me when you're dereferencing nothing. πŸ™ˆ

πŸ‘€ SEE ALSO πŸ‘€

  • ZMQ::FFI

πŸ’œ AUTHOR πŸ’œ

Dylan Cali <calid1984@gmail.com>

(we stan. thank you for your service. 🫢)


This software is copyright (c) 2023 by Dylan Cali.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

so yeah β€” free as in go wild, just keep the same terms as Perl 5 itself. legal queen behavior. ⭐


and that's the whole page, bestie!! no filler, no fluff, just two functions doing their little library-finding, version-reporting thing. this was documented under perl v5.36.0 on 2023-08-04, and that's a wrap πŸ’–βœ¨πŸŽ€ β€” go forth and use ZMQ::FFI::Util, ily, bye!! πŸ¦‹

πŸ“¦ where this page comes from