ELFTC_VERSION(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1, nixpkgs unstable

πŸ’œ ELFTC_VERSION(3) β€” the version-string bestie πŸ’œ

okay so this is a page from the Library Functions Manual (libelftc girlies rise up 🫢), and it's literally just about one tiny function that tells you what version of elftoolchain you're running. no cap, it's short and sweet.


✨ NAME ✨

elftc_version β€” returns a project-wide version identifier string πŸŽ€

πŸ“š LIBRARY πŸ“š

library β€œlibelftc” β€” that's where she lives, bestie πŸ’…

🌸 SYNOPSIS 🌸

#include <libelftc.h>

const char *
elftc_version(void);

πŸ¦‹ DESCRIPTION πŸ¦‹

Function elftc_version() returns a project-wide identifier string that encodes the source revision of the project source tree. it's giving "receipt for your whole source tree" energy 🧾✨

The returned identifier has four space-separated fields, and yes we're going through all of them because they all matter:

  • Project-Name β€” This is always β€œelftoolchain”. every time. iconic consistency, periodt πŸ‘‘
  • Project-Branch β€” The branch name for the project source tree. which branch you're on, bestie 🌿
  • Build-OS β€” The operating system that the tool chain was compiled for. like, what OS built this? πŸ–₯️
  • Version-Number β€” A tree-wide version number extracted from the version control system in use. ✨

πŸ’– RETURN VALUES πŸ’–

Function elftc_program_version() returns a pointer to an internal character buffer. (yes, the page really says elftc_program_version() here β€” that's what's written, so that's what I'm telling you πŸ™ˆπŸ’€)

lowkey important: it's a pointer to an internal buffer β€” not a fresh copy you get to keep, so don't go freeing or mangling it 🫢

🌈 EXAMPLES 🌈

To retrieve and print the current toolchain version identifier, use:

#include <sys/types.h>
#include <libelftc.h>

(void) printf("%s\n", elftc_version());

On the HEAD branch of the project's sources, when checked out using Subversion and compiled on a NetBSD host, this would print:

β€œelftoolchain HEAD NetBSD svn:REVINFO”

where REVINFO would be the current revision information for the project source tree. so cute, so informative, ate and left no crumbs πŸ“βœ¨

πŸ’€ ERRORS πŸ’€

Function elftc_program_version() always succeeds. that's it. that's the whole section. no error path, no drama, she just works πŸ˜ŒπŸ’…


🌟 and that's the whole page, bestie β€” go forth and print your version strings with confidence πŸ§šπŸ’œ

sign-off time! πŸŽ€ this page is from the Debian folks, dated December 30, 2012, and it's the ELFTC_VERSION(3) manual page. iykyk πŸ’–

πŸ“¦ where this page comes from