CupsCalls.cc File Reference

#include "CupsCalls.h"
#include <stdio.h>
#include <stdlib.h>
#include <sys/fcntl.h>
#include <cups/ppd.h>
#include <cups/cups.h>
#include <cups/language.h>
#include <ctype.h>
#include "Y2Logger.h"

Classes

struct  rdt_struct

Functions

const char * getPPD (const char *name)
bool setPrinter (const char *name, const char *info, const char *loc, const char *state, const char *statemsg, const char *bannerstart, const char *bannerend, const char *deviceuri, const set< string >allowusers, const set< string >denyusers, const char *ppd, const char *accepting)
bool setClass (const char *name, const char *info, const char *loc, const char *state, const char *statemsg, const char *bannerstart, const char *bannerend, const set< string >allowusers, const set< string >denyusers, const char *accepting, const set< string >members)
bool deletePrinter (const char *name)
bool deleteClass (const char *name)
string getDefaultDest ()
bool setDefaultDestLocal (const char *d)
bool setDefaultDest (const char *d)
bool getClasses ()
void * timebombThread (void *)
void * remoteDestinationsThread (void *rdt_v)
bool getRemoteDestinations (const char *host, YCPList &ret, ipp_op_t what_to_get, bool get_remote)
char * TOLOWER (char *src)
YCPList getPrinters (string hostname)
YCPList getClasses (string hostname)

Variables

pthread_t timebomb
pthread_t checker
pthread_cond_t reply_cv
pthread_mutex_t global
pthread_mutex_t operation
int detect_status

Function Documentation

bool deleteClass const char *  name  ) 
 

bool deletePrinter const char *  name  ) 
 

Delete printer.

Parameters:
name Printer name.
Returns:
True if successful.

YCPList getClasses string  hostname  ) 
 

bool getClasses  ) 
 

New version of get-classes that works over ipp...

string getDefaultDest  ) 
 

Get default destination.

Returns:
Name of printer.

const char* getPPD const char *  name  ) 
 

Get the ppd file for printer/class

When no ppd is assotiated with printer/class, the file is html file that contains info about an error. We must detect it and return 0.

YCPList getPrinters string  hostname  ) 
 

bool getRemoteDestinations const char *  host,
YCPList ret,
ipp_op_t  what_to_get,
bool  get_remote
 

Get printers on remote host.

Parameters:
host host name to check
what_to_get one of CUPS_GET_PRINTERS and CUPS_GET_CLASSES
ret printer names will be added here
Returns:
success state

void* remoteDestinationsThread void *  rdt_v  ) 
 

bool setClass const char *  name,
const char *  info,
const char *  loc,
const char *  state,
const char *  statemsg,
const char *  bannerstart,
const char *  bannerend,
const set< string >  allowusers,
const set< string >  denyusers,
const char *  accepting,
const set< string >  members
 

bool setDefaultDest const char *  d  ) 
 

Set default destination.

Parameters:
d Name of default destination.
Returns:
Success state.

bool setDefaultDestLocal const char *  d  ) 
 

Set default destination for client-only.

Parameters:
d Name of default destination.
Returns:
Success state.

bool setPrinter const char *  name,
const char *  info,
const char *  loc,
const char *  state,
const char *  statemsg,
const char *  bannerstart,
const char *  bannerend,
const char *  deviceuri,
const set< string >  allowusers,
const set< string >  denyusers,
const char *  ppd,
const char *  accepting
 

Modify or add printer. If any of the params is NULL, it is not set.

Parameters:
name Printer name.
info Printer info.
loc Printer location.
state Printer state.
statemsg Description of printer state.
bannerstart Banner
bannerend Banner
deviceuri 
allowusers 
denyusers 
ppd 
accepting 

void* timebombThread void *   ) 
 

char* TOLOWER char *  src  ) 
 


Variable Documentation

pthread_t checker
 

int detect_status
 

pthread_mutex_t global
 

pthread_mutex_t operation
 

pthread_cond_t reply_cv
 

pthread_t timebomb
 


Generated on Thu Jul 6 00:28:52 2006 for yast2-printer by  doxygen 1.4.6