ppd_find_choice(3)
π ppd_find_choice β bestie edition
okay so this is a page from the Library Functions Manual, and it's literally all about three lil functions that hand you back pointers to choices from PPD files. no cap. if you're out here digging through PPD files looking for a specific option or choice, these three are your girls. π
β¨ SYNOPSIS β¨
#include <ppd.h>
PpdChoice *ppd_find_choice (PpdOption *o, const char *choice);
PpdChoice *ppd_find_marked_choice (PpdFile *ppd, const char *keyword);
PpdOption *ppd_find_option_by_keyword (PpdFile *ppd, const char *keyword);
like, include the header first bestie, that's the vibe. πΈ
π DESCRIPTION π
so these three functions? they're the whole friend group that lets you, the programmer, get at the options and choices inside a PPD file. it's giving backstage pass energy. π
π PpdChoice *ppd_find_choice (PpdOption *o, const char *choice);
this one takes two parameters, periodt.
- a pointer to a PPD option structure β that's the
*o - the name of the choice you're tryna locate
that's it. that's the function. she's simple, she's iconic. β¨
π¦ PpdChoice *ppd_find_marked_choice (PpdFile *ppd, const char *keyword);
this one wants a valid PpdFile pointer (go look at ppd_file_new(3) if you need one, iykyk) plus a keyword or option name that you're hunting for inside the PPD file. hand her both and she goes looking. π
π PpdOption *ppd_find_option_by_keyword (PpdFile *ppd, const char *keyword);
okay so this one takes two parameters that are identical to the ones you'd use when you call ppd_find_marked_choice() β same ppd, same keyword. BUT. and this is the important part bestie, don't skip it:
ppd_find_option_by_keyword() does not mark the designated option as being selected.
so she finds the option, but she does not claim it. she's just looking. no strings attached. π
π RETURN VALUE π
ppd_find_choice()β returns a pointer to an option choice, andNULLin the case of a failure πppd_find_marked_choice()β returns the marked choice for the specified option, andNULLin the case of a failure πppd_find_option_by_keyword()β returns a pointer to the specified option, andNULLin the case of a failure π
so yeah, if you get NULL back, something went sideways. check your args, bestie. π«Ά
π₯ SEE ALSO π₯
these ones are the mutuals, go say hi:
ppd_file_new(3)ppd_emit_to_file(3)ppd_file_free(3)ppd_get_num_conflicts(3)ppd_check_option_is_marked(3)ppd_get_page_length(3)
π AUTHOR π
this man page was written by Gerald Carter <gcarter@valinux.com>. it was then updated by Mark Fasheh <mfasheh@valinux.com> to reflect the changes in libppd 0.5. and plot twist β some of the code for these functions was originally part of the Common UNIX Printing System (CUPS). iconic lineage fr fr. π
and that's the whole page, bestie β this was ppd_find_choice(3) from the Library Functions Manual, brought to you by libppd and dated the way the footer says it. mwah, go find your choices. ππβ¨
π¦ where this page comes from
- debian bookworm: libppd-dev 2:0.10-9 Β· GPL-2.0-or-later
- ubuntu jammy: libppd-dev 2:0.10-8 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms