shishi_asn1_read_inline(3)

πŸ“¦
version 1.0.3 Β· 3 versions
, in debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute

πŸ’… shishi_asn1_read_inline(3) β€” the shishi manual, bestie edition πŸ¦‹

okay so. picture this: you're deep in shishi, you've got an ASN.1 node, and you just wanna yoink one little field out of it and drop it into a buffer you already made. that's this function. it's giving "read, but you brought your own bucket." πŸŽ€


✨ NAME ✨

shishi_asn1_read_inline β€” an API function, and lowkey the "you handle the memory, I handle the bytes" one 🌸


✨ SYNOPSIS ✨

#include <shishi.h>

int shishi_asn1_read_inline(Shishi * handle, Shishi_asn1 node, const
char * field, char * data, size_t * datalen);

no cap, that's the whole vibe. 🫢


✨ ARGUMENTS ✨

  • Shishi * handle β€” the shishi handle, and you got it from shishi_init(). it's the main character of every shishi function fr fr πŸ‘‘
  • Shishi_asn1 node β€” the ASN.1 variable you're reading a field from. the source. the origin story. πŸ’«
  • const char * field β€” the name of the field inside node that you wanna read. just the name, babes. πŸ”
  • char * data β€” a pre-allocated output buffer that will hold the ASN.1 field data. pre-allocated, okay? you bring it, this function fills it. πŸ’–
  • size_t * datalen β€” the multitasking queen: on input it's the maximum size of the output buffer, and on output it's the actual size of the output buffer. glow up mid-call, we love that. ✨

✨ DESCRIPTION ✨

so what it does: it extracts the data stored in an ASN.1 field and drops it into a fixed size buffer allocated by the caller. that's you. you're the caller. the buffer is your problem. 🫑

⚠️ ngl, because it's genuinely difficult to predict the length of the field, it's often better to use shishi_asn1_read() instead. like, the buffer-based life is not always the move, bestie. consider it. πŸ™ˆ

✨ RETURN VALUE ✨

  • SHISHI_OK β€” slayed. it worked. πŸ’…
  • SHISHI_ASN1_NO_ELEMENT β€” the element do not exist 😭 (it's just not there)
  • SHISHI_ASN1_NO_VALUE β€” the field has no value, it's giving empty πŸ’€
  • SHISHI_ASN1_ERROR β€” otherwise. something went sideways. 🌧️

✨ REPORTING BUGS ✨

found a bug? don't suffer in silence, tell the devs πŸ›πŸ’Œ


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. (yes queen, royalty-free, as long as you keep the receipts πŸ“œβœ¨)


✨ 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. go read it, iykyk πŸ“–πŸ’œ


and that's the whole page!! mwah πŸ’‹

this was shishi_asn1_read_inline(3) from the shishi manual, version 1.0.3 β€” dated, iconic, and available at your local terminal. take care of your buffers, bestie πŸŽ€πŸ¦‹