shishi_principal_name(3)

πŸ“¦
version 1.0.3 Β· 2 versions
  • 1.0.3 Β· debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.0.2 Β· ubuntu jammy
, in debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– shishi_principal_name β€” the shishi_principal_name(3) era πŸ’–

okay bestie, gather round, because today we're decoding shishi_principal_name(3) β€” yes it's a real manual page from the shishi library, and yes it's lowkey iconic. it's an API function, it's giving "i do one thing and i do it flawlessly", and we're gonna get into every single detail together. no cap. πŸ¦‹


✨ SYNOPSIS ✨

#include <shishi.h>

int shishi_principal_name(Shishi * handle, Shishi_asn1 namenode, const
char * namefield, char ** out, size_t * outlen);

that's the whole vibe right there. one include, one function call, five arguments, zero drama (well, mostly, wait for the deallocation part, it's giving ✨responsibility✨). πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

okay so these are the five things you gotta hand over. no skipping any of them, fr fr:

  • Shishi * handle β€” the Shishi library handle, and you get it from shishi_init(). like, this is your ✨main character✨ library object, you can't just show up without it.
  • Shishi_asn1 namenode β€” an ASN.1 structure that has a principal chilling inside it in namefield. that's the container, bestie.
  • const char * namefield β€” the name of the field inside namenode that's holding the principal name. so like, you point at the spot inside the struct where the name lives. 🫢
  • char ** out β€” pointer to a newly allocated, null terminated string that contains the principal name. and here's the tea: it may be NULL (in which case you're only populating outlen, no string for you).
  • size_t * outlen β€” pointer to the length of out on output, and it does not include the terminating null. also may be NULL (and then you're only populating out). so you can pass NULL for one or the other but the whole point is you gotta get something, iykyk.

🌸 DESCRIPTION 🌸

so what does it actually do? it takes the principal name inside that ASN.1 structure and represents it as a null-terminated string. that's it. that's the function. iconic behaviour honestly. πŸ’œ

the string is allocated by this function, and β€” this is the important part, don't scroll past β€” it is the responsibility of the caller to deallocate it. meaning you, bestie. you free it. the function is not gonna clean up after you, it is not your mom, it handed you a freshly malloc'd string and walked away. 😭

also note: the output length outlen does not include the terminating null. so if you're out here doing math with it, account for that extra byte yourself. 🌈


⭐ RETURN VALUE ⭐

returns SHISHI_OK if successful. that's the win condition. that's the slay. πŸ”₯


πŸ› REPORTING BUGS πŸ›

found something cursed? report bugs to <bug-shishi@gnu.org>. like, actually email them, they wanna know.

go forth and file that bug, you're doing amazing sweetie. πŸ™ˆ


Copyright Β© 2002-2022 Simon Josefsson.

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved.

(so like, you can copy it, you can remix it, you can distribute it, just keep the receipts. periodt. πŸ’…)


🧚 SEE ALSO 🧚

The full documentation for shishi is maintained as a Texinfo manual. If the info and shishi programs are properly installed at your site, the command

info shishi

should give you access to the complete manual. (bestie run that command, the full lore is in there πŸ“–βœ¨)


okay that's the whole page, every flag, every arg, every copyright line, untouched, just wrapped in glitter. the vibes are immaculate and the facts are exactly the same. no cap. 🫢

shishi version 1.0.3, page shishi_principal_name(3) β€” mwah, sending you off with a lil forehead kiss, go deallocate your strings bestie πŸ’–πŸŽ€πŸ¦‹