---
name: "ppd_find_choice"
section: "3"
platform: "linux"
package: "libppd-dev"
version: "2:0.10-9"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/ppd_find_choice"
---

# ppd\_find\_choice(3)

set of functions for returning pointers to choices from PPD files.

## NAME

ppd\_find\_choice, ppd\_find\_marked\_choice, ppd\_find\_option\_by\_keyword - set of functions for returning pointers to choices from PPD files.

## 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);**

## DESCRIPTION

These three functions allow the programmer access options and choices within a PPD file.

### PpdChoice \*ppd\_find\_choice (PpdOption \*o, const char \*choice);

This function accepts two parameters.  The first is a pointer to a  PPD option structure and the second is the name of the choice to locate.

### PpdChoice \*ppd\_find\_marked\_choice (PpdFile \*ppd, const char \*keyword);

This function accepts a valid PpdFile pointer (see **[ppd\_file\_new(3)](/ppd_file_new/3.md)**)  and a keyword or option name to locate in the PPD file.

### PpdOption \*ppd\_find\_option\_by\_keyword (PpdFile \*ppd, const char \*keyword);

This function accepts two parameters which are identical to those used when invoking the ppd\_find\_marked\_choice() function.  However, the ppd\_find\_option\_by\_keyword() function does not mark the designated option as being selected.

## RETURN VALUE

- ppd\_find\_choice()

  Return a pointer to an option choice; NULL in the case of a failure

- ppd\_find\_marked\_choice()

  Return the marked choice for the specified option; NULL in the case of a failure

- ppd\_find\_option\_by\_keyword()

  Return a pointer to the specified option; NULL in the case of a failure

## SEE ALSO

[ppd\_file\_new(3)](/ppd_file_new/3.md), [ppd\_emit\_to\_file(3)](/ppd_emit_to_file/3.md), [ppd\_file\_free(3)](/ppd_file_free/3.md), [ppd\_get\_num\_conflicts(3)](/ppd_get_num_conflicts/3.md), [ppd\_check\_option\_is\_marked(3)](/ppd_check_option_is_marked/3.md), [ppd\_get\_page\_length(3)](/ppd_get_page_length/3.md)

## AUTHOR

This man page was written by Gerald Carter \<gcarter@valinux.com\>. It was updated by Mark Fasheh \<mfasheh@valinux.com\> to reflect  changes in libppd 0.5 Some of the code for these functions was originally part of the Common UNIX Printing System (CUPS).
