Software: Apache/2.2.3 (CentOS). PHP/5.1.6 uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/share/doc/cups-1.3.7/help/ drwxr-xr-x |
Viewing file: api-cups.html (54.82 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) | IntroductionThe CUPS library provides a whole collection of interfaces needed to support the internal needs of the CUPS software as well as the needs of applications, filters, printer drivers, and backends. Unlike the rest of CUPS, the CUPS API library is provided under the GNU Library General Public License. This means that you can use the CUPS API library in both proprietary and open-source programs. General UsageThe <cups/cups.h> header file must be included to use the CUPS functions. Programs using these functions must be linked to the CUPS library: libcups.a, libcups.so.2, libcups.2.dylib, libcups_s.a, or libcups2.lib depending on the platform. The following command compiles myprogram.c using GCC and the CUPS library: gcc -o myprogram myprogram.c -lcups CompatibilityUnless otherwise specified, the CUPS API functions require CUPS 1.1 or higher. ContentsEnumerationscups_ptype_eDescriptionNot a typedef'd enum so we can OR Values
Functions
cupsAddDest()DescriptionAdd a destination to the list of destinations. This function cannot be used to add a new class or printer queue, it only adds a new container of saved options for the named destination or instance. If the named destination already exists, the destination list is returned unchanged. Adding a new instance of a destination creates a copy of that destination's options. Use the cupsSaveDests() function to save the updated list of destinations to the user's lpoptions file. Syntax
int Arguments
ReturnsNew number of destinations cupsAddOption()DescriptionAdd an option to an option array. Syntax
int Arguments
ReturnsNumber of options cupsCancelJob()DescriptionCancel a print job on the default server. Use the cupsLastError() and cupsLastErrorString() functions to get the cause of any failure. Syntax
int Arguments
Returns1 on success, 0 on failure cupsEncryption()DescriptionGet the default encryption settings. The default encryption setting comes from the CUPS_ENCRYPTION environment variable, then the ~/.cupsrc file, and finally the /etc/cups/client.conf file. If not set, the default is HTTP_ENCRYPT_IF_REQUESTED. Syntax
http_encryption_t ArgumentsNone. ReturnsEncryption settings cupsFreeDests()DescriptionFree the memory used by the list of destinations. Syntax
void Arguments
ReturnsNothing. cupsFreeJobs()DescriptionFree memory used by job data. Syntax
void Arguments
ReturnsNothing. cupsFreeOptions()DescriptionFree all memory used by options. Syntax
void Arguments
ReturnsNothing. DEPRECATED cupsGetClasses()DescriptionGet a list of printer classes from the default server. This function is deprecated - use cupsGetDests() instead. Syntax
int Arguments
ReturnsNumber of classes cupsGetDefault()DescriptionGet the default printer or class for the default server. This function returns the default printer or class as defined by the LPDEST or PRINTER environment variables. If these environment variables are not set, the server default destination is returned. Applications should use the cupsGetDests() and cupsGetDest() functions to get the user-defined default printer, as this function does not support the lpoptions-defined default printer. Syntax
const char * ArgumentsNone. ReturnsDefault printer or NULL CUPS 1.1.21 cupsGetDefault2()DescriptionGet the default printer or class for the specified server. This function returns the default printer or class as defined by the LPDEST or PRINTER environment variables. If these environment variables are not set, the server default destination is returned. Applications should use the cupsGetDests() and cupsGetDest() functions to get the user-defined default printer, as this function does not support the lpoptions-defined default printer. Syntax
const char * Arguments
ReturnsDefault printer or NULL cupsGetDest()DescriptionGet the named destination from the list. Use the cupsGetDests() or cupsGetDests2() functions to get a list of supported destinations for the current user. Syntax
cups_dest_t * Arguments
ReturnsDestination pointer or NULL cupsGetDests()DescriptionGet the list of destinations from the default server. Starting with CUPS 1.2, the returned list of destinations include the printer-info, printer-is-accepting-jobs, printer-is-shared, printer-make-and-model, printer-state, printer-state-change-time, printer-state-reasons, and printer-type attributes as options. Use the cupsFreeDests() function to free the destination list and the cupsGetDest() function to find a particular destination. Syntax
int Arguments
ReturnsNumber of destinations CUPS 1.1.21 cupsGetDests2()DescriptionGet the list of destinations from the specified server. Starting with CUPS 1.2, the returned list of destinations include the printer-info, printer-is-accepting-jobs, printer-is-shared, printer-make-and-model, printer-state, printer-state-change-time, printer-state-reasons, and printer-type attributes as options. Use the cupsFreeDests() function to free the destination list and the cupsGetDest() function to find a particular destination. Syntax
int Arguments
ReturnsNumber of destinations CUPS 1.1.20 cupsGetFd()DescriptionGet a file from the server. This function returns HTTP_OK when the file is successfully retrieved. Syntax
http_status_t Arguments
ReturnsHTTP status CUPS 1.1.20 cupsGetFile()DescriptionGet a file from the server. This function returns HTTP_OK when the file is successfully retrieved. Syntax
http_status_t Arguments
ReturnsHTTP status cupsGetJobs()DescriptionGet the jobs from the default server. Syntax
int Arguments
ReturnsNumber of jobs CUPS 1.1.21 cupsGetJobs2()DescriptionGet the jobs from the specified server. Syntax
int Arguments
ReturnsNumber of jobs cupsGetOption()DescriptionGet an option value. Syntax
const char * Arguments
ReturnsOption value or NULL cupsGetPPD()DescriptionGet the PPD file for a printer on the default server. For classes, cupsGetPPD() returns the PPD file for the first printer in the class. Syntax
const char * Arguments
ReturnsFilename for PPD file CUPS 1.1.21 cupsGetPPD2()DescriptionGet the PPD file for a printer from the specified server. For classes, cupsGetPPD2() returns the PPD file for the first printer in the class. Syntax
const char * Arguments
ReturnsFilename for PPD file cupsGetPassword()DescriptionGet a password from the user. Uses the current password callback function. Returns NULL if the user does not provide a password. Syntax
const char * Arguments
ReturnsPassword DEPRECATED cupsGetPrinters()DescriptionGet a list of printers from the default server. This function is deprecated - use cupsGetDests() instead. Syntax
int Arguments
ReturnsNumber of printers CUPS 1.3 cupsGetServerPPD()DescriptionGet an available PPD file from the server. This function returns the named PPD file from the server. The list of available PPDs is provided by the IPP CUPS_GET_PPDS operation. You must remove (unlink) the PPD file when you are finished with it. The PPD filename is stored in a static location that will be overwritten on the next call to cupsGetPPD(), cupsGetPPD2(), or cupsGetServerPPD(). Syntax
char * Arguments
ReturnsName of PPD file or NULL on error cupsLangDefault()DescriptionReturn the default language. Syntax
cups_lang_t * ArgumentsNone. ReturnsLanguage data cupsLangEncoding()DescriptionReturn the character encoding (us-ascii, etc.) for the given language. Syntax
const char * Arguments
ReturnsCharacter encoding cupsLangFlush()DescriptionFlush all language data out of the cache. Syntax
void ArgumentsNone. ReturnsNothing. cupsLangFree()DescriptionFree language data. This does not actually free anything; use cupsLangFlush() for that. Syntax
void Arguments
ReturnsNothing. cupsLangGet()DescriptionGet a language. Syntax
cups_lang_t * Arguments
ReturnsLanguage data cupsLastError()DescriptionReturn the last IPP status code. Syntax
ipp_status_t ArgumentsNone. ReturnsIPP status code from last request CUPS 1.2 cupsLastErrorString()DescriptionReturn the last IPP status-message. Syntax
const char * ArgumentsNone. Returnsstatus-message text from last request cupsMarkOptions()DescriptionMark command-line options in a PPD file. Syntax
int Arguments
Returns1 if conflicting CUPS 1.2 cupsNotifySubject()DescriptionReturn the subject for the given notification message. The returned string must be freed by the caller using free(). Syntax
char * Arguments
ReturnsSubject string or NULL CUPS 1.2 cupsNotifyText()DescriptionReturn the text for the given notification message. The returned string must be freed by the caller using free(). Syntax
char * Arguments
ReturnsMessage text or NULL cupsParseOptions()DescriptionParse options from a command-line argument. This function converts space-delimited name/value pairs according to the PAPI text option ABNF specification. Collection values ("name={a=... b=... c=...}") are stored with the curley brackets intact - use cupsParseOptions() on the value to extract the collection attributes. Syntax
int Arguments
ReturnsNumber of options found cupsPrintFile()DescriptionPrint a file to a printer or class on the default server. Syntax
int Arguments
ReturnsJob ID CUPS 1.1.21 cupsPrintFile2()DescriptionPrint a file to a printer or class on the specified server. Syntax
int Arguments
ReturnsJob ID cupsPrintFiles()DescriptionPrint one or more files to a printer or class on the default server. Syntax
int Arguments
ReturnsJob ID CUPS 1.1.21 cupsPrintFiles2()DescriptionPrint one or more files to a printer or class on the specified server. Syntax
int Arguments
ReturnsJob ID CUPS 1.1.20 cupsPutFd()DescriptionPut a file on the server. This function returns HTTP_CREATED when the file is stored successfully. Syntax
http_status_t Arguments
ReturnsHTTP status CUPS 1.1.20 cupsPutFile()DescriptionPut a file on the server. This function returns HTTP_CREATED when the file is stored successfully. Syntax
http_status_t Arguments
ReturnsHTTP status CUPS 1.3 cupsRemoveDest()DescriptionRemove a destination from the destination list. Removing a destination/instance does not delete the class or printer queue, merely the lpoptions for that destination/instance. Use the cupsSetDests() or cupsSetDests2() functions to save the new options for the user. Syntax
int Arguments
ReturnsNew number of destinations CUPS 1.2 cupsRemoveOption()DescriptionRemove an option from an option array. Syntax
int Arguments
ReturnsNew number of options cupsServer()DescriptionReturn the hostname/address of the default server. The returned value can be a fully-qualified hostname, a numeric IPv4 or IPv6 address, or a domain socket pathname. Syntax
const char * ArgumentsNone. ReturnsServer name CUPS 1.3 cupsSetDefaultDest()DescriptionSet the default destination. Syntax
void Arguments
ReturnsNothing. cupsSetDests()DescriptionSave the list of destinations for the default server. This function saves the destinations to /etc/cups/lpoptions when run as root and ~/.cups/lpoptions when run as a normal user. Syntax
void Arguments
ReturnsNothing. CUPS 1.1.21 cupsSetDests2()DescriptionSave the list of destinations for the specified server. This function saves the destinations to /etc/cups/lpoptions when run as root and ~/.cups/lpoptions when run as a normal user. Syntax
int Arguments
Returns0 on success, -1 on error cupsSetEncryption()DescriptionSet the encryption preference. Syntax
void Arguments
ReturnsNothing. cupsSetPasswordCB()DescriptionSet the password callback for CUPS. Pass NULL to restore the default (console) password callback. Syntax
void Arguments
ReturnsNothing. cupsSetServer()DescriptionSet the default server name. The "server" string can be a fully-qualified hostname, a numeric IPv4 or IPv6 address, or a domain socket pathname. Pass NULL to restore the default server name. Syntax
void Arguments
ReturnsNothing. cupsSetUser()DescriptionSet the default user name. Pass NULL to restore the default user name. Syntax
void Arguments
ReturnsNothing. cupsTempFd()DescriptionCreates a temporary file. The temporary filename is returned in the filename buffer. The temporary file is opened for reading and writing. Syntax
int Arguments
ReturnsNew file descriptor or -1 on error DEPRECATED cupsTempFile()DescriptionGenerates a temporary filename. The temporary filename is returned in the filename buffer. This function is deprecated - use cupsTempFd() or cupsTempFile2() instead. Syntax
char * Arguments
ReturnsFilename or NULL on error CUPS 1.2 cupsTempFile2()DescriptionCreates a temporary CUPS file. The temporary filename is returned in the filename buffer. The temporary file is opened for writing. Syntax
cups_file_t * Arguments
ReturnsCUPS file or NULL on error cupsUser()DescriptionReturn the current user's name. Syntax
const char * ArgumentsNone. ReturnsUser name Structurescups_dest_sDescriptionDestination Definition
struct cups_dest_s Members
cups_job_sDescriptionJob Definition
struct cups_job_s Members
cups_option_sDescriptionPrinter Options Definition
struct cups_option_s Members
Typescups_dest_tDescriptionDestination Definitiontypedef struct cups_dest_s cups_dest_t; cups_job_tDescriptionJob Definitiontypedef struct cups_job_s cups_job_t; cups_option_tDescriptionPrinter Options Definitiontypedef struct cups_option_s cups_option_t; cups_password_cb_tDescriptionPassword callback Definitiontypedef const char * (*cups_password_cb_t)(const char *); cups_ptype_tDescriptionPrinter Type/Capability Bits Definitiontypedef unsigned cups_ptype_t; |
:: Command execute :: | |
:: Shadow's tricks :D :: | |
Useful Commands
|
:: Preddy's tricks :D :: | |
Php Safe-Mode Bypass (Read Files)
|
--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0141 ]-- |