Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xpgetprinterlist(3xp) [debian man page]

XpGetPrinterList(3Xp)						 XPRINT FUNCTIONS					     XpGetPrinterList(3Xp)

NAME
XpGetPrinterList - Retrieves a list of all printers supported on an X Print Server. SYNOPSIS
cc [ flag... ] file... -lXp [ library... ] #include <X11/extensions/Print.h> XPPrinterList XpGetPrinterList ( display, printer_name, list_count_return ) Display *display; char *printer_name; int *list_count_return; ARGUMENTS
display Specifies a pointer to the Display structure; returned from XOpenDisplay. printer_name Specifies the name of the printer for which information is desired. If NULL, then information is returned for all printers associ- ated with the server. list_count_return Returns the number of printers in the list. DESCRIPTION
XpGetPrinterList returns a list of printer records where each record describes a printer supported by the X Print Server, or NULL if any errors occur. If printer_name is NULL, then a list of all printers supported is returned. If printer_name is non-NULL, only print records matching printer_name are returned, and if no records match printer_name , then NULL is returned. printer_name is a COMPOUND_TEXT string, and the name and desc fields in the returned list will be in COMPOUND_TEXT (note, ISO 8859-1 (Latin-1) is a proper subset of COMPOUND_TEXT, so can be used directly). If printer_name is in a code-set that the X Print Server cannot convert (into its operating code-set), then the X Print Server may fail to locate the requested printer. If printer_name is NULL, then all printer names, regardless of their code-set, can be returned, leaving the task of specific printer recognition up to the caller. When XpGetPrinterList is called, the caller's locale (see XpSetLocaleHinter) is included in the request as a "hint" to the X Print Server. If supported by the implementation, the X Print Server will use the hint to locate a localized description for each printer in the list. If the X Print Server cannot understand the hint, the X Print Server will choose a default. The returned printer list can be freed by calling XpFreePrinterList. The XPPrinterList structure defined in <X11/extensions/Print.h> contains: typedef struct { char *name; /* name */ char *desc; /* localized description */ } XPPrinterRec, *XPPrinterList; DIAGNOSTICS
BadAlloc Insufficient memory. SEE ALSO
XpFreePrinterList(3Xp), XpSetLocaleHinter(3Xp) X Version 11 libXp 1.0.0 XpGetPrinterList(3Xp)

Check Out this Related Man Page

XpSetLocaleHinter(3Xp)						 XPRINT FUNCTIONS					    XpSetLocaleHinter(3Xp)

NAME
XpSetLocaleHinter - Sets a "locale hinter" function and description of it. SYNOPSIS
cc [ flag... ] file... -lXp [ library... ] #include <X11/extensions/Print.h> void XpSetLocaleHinter ( hinter_proc hinter_desc ) XPHinterProc hinter_proc; char *hinter_desc; ARGUMENTS
hinter_proc A pointer to a "hinter proc". hinter_desc A pointer to contextual information about the locale hinter proc. DESCRIPTION
Since (to date) there is no single industry standard for locale values, locale information about the current client required by XpCreate- Context, XpGetPrinterList and XpGetPdmStartParams is at best considered a "hint" when transmitted to the X Print Server and PDM. In single vendor environments, the locale hint should be consistent and understood. In multi-vendor environments however, the locale hint may or may not be understood. The caller locale will be used as the fallback default. XpSetLocaleHinter and XpGetLocaleHinter access hooks that are used to register more advanced hint generators. By default, Xp uses a hinter proc that calls setlocale on the CTYPE category on POSIX systems, and hinter_desc is NULL. XpSetLocaleHinter sets the hinter_proc and hinter_desc which will be subsequently used by the Xp calls requiring a locale hint (see above). hinter_proc is the function that will generate the locale hint (for example, "C"), and hinter_desc is a string, with or without the embed- dable keyword %locale%, that provides a higher level context for the results of hinter_proc. If hinter_proc is set to NULL, then the default Xp hinter proc is installed. XpSetLocaleHinter makes its own private copy of hinter_desc prior to returning. An example set call might look as follows: XpSetLocaleHinter( my_hinter, "%locale%;CDElocale" ); Where my_hinter might look as follows: char *my_hinter() { /* * Use setlocale() to retrieve the current locale. */ return( my_x_strdup( setlocale(LC_CTYPE, (char *) NULL) ) ); } When the client's locale is needed, if both hinter_desc and the results of hinter_proc are non-NULL, and the keyword %locale% is found in hinter_desc, then the keyword will be replaced with the result of hinter_proc. The resulting string will be used as the locale hint by the Xp calls. If both hinter_desc and the results of hinter_proc are non-NULL, but the keyword %locale% is not found in hinter_desc, then hinter_desc, as is, becomes the string used as the locale hint by the Xp calls. If one of hinter_desc or the results of hinter_proc is NULL, then the other non-NULL value becomes the string used as the locale hint by the Xp calls. If hinter_desc and the results of hinter_proc are NULL, then a NULL (i.e. (char *) NULL) locale hint is sent by the Xp calls. The syntax for hinter_desc is a variation of the unadopted X/Open standard for a "String Network Locale-Specification Syntax" (X/Open, Dis- tributed Internationalization Services, Version 2, 1994 Snapshot). The Xp hinter_desc syntax is: name_spec[;registry_spec[;ver_spec[;encoding_spec]]] In Xp, the first item is the locale name, followed by progressively more detailed information about the locale name, with each piece of information separated by a `;'. STRUCTURES
The signature for hinter_proc is defined in <X11/extensions/Print.h> as follows: typedef char * (*XPHinterProc)(); hinter_proc is expected to return a string that can be freed using XFree by the Xp calls themselves. Some examples include ( hinter_desc to left, expanded results to the right): CFRENCH CFRENCH %locale% C %locale%;CDElocale C;CDElocale %locale%;HP C;HP %locale%;IBM C;IBM %locale%;XOPEN;01_11;XFN-001001 de_DE;XOPEN;01_11;XFN-001001 FILES
<X11/extensions/Print.h> SEE ALSO
XpCreateContext(3Xp), XpGetLocaleHinter(3Xp), XpGetPdmStartParams(3Xp), XpGetPrinterList(3Xp), XpSetLocaleHinter(3Xp) X Version 11 libXp 1.0.0 XpSetLocaleHinter(3Xp)
Man Page