shishi_prompt_...rd_callback_set(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_prompt_password_callback_set β€” the shishi manual, bestie edition πŸ’–

okay so real talk, this page lives in the shishi manual, and it's all about one lil API function that lets you take over the password-asking duties. let's get into it ✨


🌸 NAME 🌸

shishi_prompt_password_callback_set β€” it's an API function, bestie. that's the whole vibe.


πŸŽ€ SYNOPSIS πŸŽ€

#include <shishi.h>

void shishi_prompt_password_callback_set(Shishi * handle,
shishi_prompt_password_func cb);

look at her. iconic. two args, returns nothing, just does her thing πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • Shishi * handle β€” this is your shishi handle, and no you can't just make one up out of thin air. it's allocated by shishi_init(), okay? that's the origin story.
  • shishi_prompt_password_func cb β€” a function pointer to your application's password callback. the type is literally shishi_prompt_password_func. it's giving "bring your own function" energy fr fr.

✨ DESCRIPTION ✨

so here's the tea β˜• β€” you call this to set a callback function that shishi_prompt_password() will use to go ask the user for a password. like, instead of shishi doing the asking itself, it hands the mic to your function. main character energy, honestly πŸ‘‘

and if you ever need to grab that function pointer back? shishi_prompt_password_callback_get() has you covered. it's right there, iykyk.

your cb function needs to follow the shishi_prompt_password_func prototype, and it looks exactly like this:

int prompt_password (Shishi * handle, char **s, const char *format,
va_list ap);

now listen closely because this part matters 🫢 β€” if the function returns 0, then the s variable should contain a newly allocated string holding the password that was read from the user. no cap, that's the contract. don't fumble it.


😭 REPORTING BUGS 😭

found a bug? don't suffer in silence, bestie. report it to <bug-shishi@gnu.org>. πŸ’Œ


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, go forth and share, just keep the receipts okay? πŸŽ€


🌈 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, this command:

info shishi

should give you access to the complete manual. go read it, it's the director's cut πŸ’œ


and that's the whole page, bestie!! this was shishi version 1.0.3, straight from the shishi manual (section 3, the library-function girlies πŸ’…). now go set that callback and slay βœ¨πŸ¦‹πŸŒΈ