shishi_init_with_paths(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_init_with_paths ✨

okay bestie, so this one is shishi_init_with_paths from the shishi manual, section 3, and it's literally the glow-up version of setting up your Shishi library handle when you're feeling picky about where your files live. let's get into it πŸ’…


🌸 NAME 🌸

shishi_init_with_paths β€” API function. yeah that's it, that's the whole name. short, sweet, iconic.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <shishi.h>

int shishi_init_with_paths(Shishi ** handle, const char * tktsfile,
       const char * systemcfgfile, const char * usercfgfile);

πŸŽ€ ARGUMENTS πŸŽ€

  • Shishi ** handle β€” pointer to a Shishi handle that this very call creates for you. it's giving "i made this, it's mine now" 🫢
  • const char * tktsfile β€” filename of the ticket file, or NULL. either you tell it where, or you pass NULL, no in-between.
  • const char * systemcfgfile β€” filename of the system configuration, or NULL. same deal.
  • const char * usercfgfile β€” filename of the user configuration, or NULL. yes bestie, also optional.

πŸ’– DESCRIPTION πŸ’–

So what it does: it creates a Shishi library handle (using shishi() under the hood, cute), and then it reads the system configuration file, the user configuration file, and the user tickets β€” all from the locations you specified. custom paths, main character energy.

But here's the tea on NULL:

  • if usercfgfile or systemcfgfile is NULL, that file gets read from its default location instead.
  • for the system configuration, the default is decided at compile time, and it is $sysconfdir/shishi.conf.
  • for the user configuration, the default is $HOME/.shishi/config. yes, the dotfile era, we love her.
  • if the ticket file name is NULL, a ticket file is not read at all. zero tickets, no notes.
⚠️ important, bestie: the handle is allocated regardless of return value. like, she's showing up either way. the single exception is SHISHI_HANDLE_ERROR, which means there was a problem allocating the handle itself. and yeah, other error conditions could totally arise while reading files. so check your return values, okay? i'm not playing πŸ™ˆ

🌈 RETURN VALUE 🌈

Returns SHISHI_OK iff successful. that's the only vibe we want. ✨


😭 REPORTING BUGS 😭

Found a bug? do not suffer in silence, tell the people:


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. 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. iykyk 🧚


that's the whole page, bestie!! this one came from the shishi manual, version 1.0.3, and it's filed under shishi_init_with_paths(3) β€” so if you ever need to find her again, you know exactly where she lives. slay, go configure something responsibly πŸ’–βœ¨πŸ¦‹