Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

ppd_find_choice(3) [debian man page]

ppd_find_choice(3)					     Library Functions Manual						ppd_find_choice(3)

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)) 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_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 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). ppd_find_choice(3)

Check Out this Related Man Page

ppd_emit_to_file(3)					     Library Functions Manual					       ppd_emit_to_file(3)

NAME
ppd_emit_to_file, ppd_emit_to_fd - Output device specific code. SYNOPSIS
#include <ppd/ppd.h> gboolean ppd_emit( PpdFile * ppd,FILE *fp,PpdSectionOrder section ); gboolean ppd_emitfd( PpdFile * ppd, int fd,PpdSectionOrder section ); DESCRIPTION
The ppd_emit_* functions output the device specific code appropriate to the specified section that has not already been emitted.. The PpdFile pointer is obtained from opening a PPD file via the ppd_load(3) family of functions. The section can be any one of the following: PPD_ORDER_ANY Option code can be anywhere in the file PPD_ORDER_DOCUMENT Option code must be in the DocumentSetup section PPD_ORDER_EXIT Option code must be sent prior to the document PPD_ORDER_JCL Option code must be sent as a JCL command PPD_ORDER_PAGE Option code must be in the PageSetup section PPD_ORDER_PROLOG Option code must be in the Prolog section The sections PPD_ORDER_DOCUMENT and PPD_ORDER_PAGE will also output code from the PPD_ORDER_ANY section. Once a code section has been emitted it is marked as such and will not be emitted unless it is re-marked. EXAMPLE
/* Setup code to emitted */ ppd_mark_defaults(ppd); ppd_mark_option(ppd,"Duplex","DuplexNoTumble"); ppd_mark_option(ppd,"PageSize","A4"); /* Emit initial code (including any reset and JCL code) */ ppd_emit_to_file(ppd,stdout,PPD_ORDER_EXIT); fputs(ppd->jcl_begin->str,stdout); ppd_emit_to_file(ppd, stdout, PPD_ORDER_JCL); fputs(ppd->jcl_ps->str, stdout); /* Any header comments go here */ ... /* Prolog section */ printf("%%%%BeginProlog0); ppd_emit_to_file(ppd, stdout, PPD_ORDER_PROLOG); printf("%%%%EndProlog0); /* Setup section */ printf("%%%%BeginSetup0); ppd_emit_to_file(ppd, stdout, PPD_ORDER_DOCUMENT); printf("%%%%EndSetup0); /* Main document begins */ for (...) { printf("%%%%Page: 1 10); /* Re-mark so that this is emitted on each page */ ppd_mark_option(ppd,"PageSize","A4"); printf("%%%%PageSetup0); ppd_emit_to_file(ppd, stdout, PPD_ORDER_PAGE); printf("%%%%EndPageSetup0); /* Page info goes here */ ... } /* Send ending JCL code */ fputs(ppd->jcl_end->str,stdout); SEE ALSO
ppd_file_new(3), ppd_file_free(3) ppd_emit_to_file(3)
Man Page