netatalk  4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
lp.c File Reference
#include <sys/param.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <ctype.h>
#include <unistd.h>
#include <sys/file.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <netdb.h>
#include <fcntl.h>
#include <pwd.h>
#include <atalk/logger.h>
#include <netatalk/at.h>
#include <atalk/atp.h>
#include <atalk/unicode.h>
#include "printer.h"
#include "file.h"
#include "lp.h"
#include "print_cups.h"

Data Structures

struct  lp
 

Macros

#define LP_INIT   (1<<0)
 
#define LP_OPEN   (1<<1)
 
#define LP_PIPE   (1<<2)
 
#define LP_CONNECT   (1<<3)
 
#define LP_QUEUE   (1<<4)
 
#define LP_JOBPENDING   (1<<5)
 
#define is_var(a, b)   (strncmp((a), (b), 2) == 0)
 
#define BUFSIZE   32768
 

Functions

int rresvport (int *alport)
 
int lp_conn_inet ()
 
int lp_disconn_inet (int)
 
int lp_conn_unix ()
 
int lp_disconn_unix (int)
 
void lp_origin (int origin)
 
static void convert_octal (char *string, charset_t dest)
 
static void translate (charset_t from, charset_t dest, char **option)
 
static void lp_setup_comments (charset_t dest)
 
void lp_person (char *person)
 
void lp_host (char *host)
 
void lp_job (char *job)
 
void lp_for (char *lpfor)
 
static int lp_init (struct papfile *out, struct sockaddr_at *sat)
 
int lp_open (struct papfile *out, struct sockaddr_at *sat)
 
int lp_close (void)
 
int lp_write (struct papfile *in, char *buf, size_t len)
 
int lp_cancel (void)
 
int lp_print (void)
 Create printcap control file, signal printer.
 

Variables

static char hostname [MAXHOSTNAMELEN]
 
struct sockaddr_atsat
 
static struct lp lp
 

Detailed Description

Interface to lpr system.

Macro Definition Documentation

◆ BUFSIZE

#define BUFSIZE   32768

◆ is_var

#define is_var (   a,
 
)    (strncmp((a), (b), 2) == 0)

◆ LP_CONNECT

#define LP_CONNECT   (1<<3)

◆ LP_INIT

#define LP_INIT   (1<<0)

◆ LP_JOBPENDING

#define LP_JOBPENDING   (1<<5)

◆ LP_OPEN

#define LP_OPEN   (1<<1)

◆ LP_PIPE

#define LP_PIPE   (1<<2)

◆ LP_QUEUE

#define LP_QUEUE   (1<<4)

Function Documentation

◆ convert_octal()

static void convert_octal ( char *  string,
charset_t  dest 
)
static

◆ lp_cancel()

int lp_cancel ( void  )

cancel current job

◆ lp_close()

int lp_close ( void  )

close current spooling file

◆ lp_conn_inet()

int lp_conn_inet ( )

◆ lp_conn_unix()

int lp_conn_unix ( )

◆ lp_disconn_inet()

int lp_disconn_inet ( int  )

◆ lp_disconn_unix()

int lp_disconn_unix ( int  )

◆ lp_for()

void lp_for ( char *  lpfor)

◆ lp_host()

void lp_host ( char *  host)

◆ lp_init()

static int lp_init ( struct papfile out,
struct sockaddr_at sat 
)
static

◆ lp_job()

void lp_job ( char *  job)

◆ lp_open()

int lp_open ( struct papfile out,
struct sockaddr_at sat 
)

open a file for spooling

◆ lp_origin()

void lp_origin ( int  origin)

◆ lp_person()

void lp_person ( char *  person)

◆ lp_print()

int lp_print ( void  )

Create printcap control file, signal printer.

Note
Errors here should remove queue files.

XXX piped?

◆ lp_setup_comments()

static void lp_setup_comments ( charset_t  dest)
static

◆ lp_write()

int lp_write ( struct papfile in,
char *  buf,
size_t  len 
)

open a buffer to the current open file

◆ rresvport()

int rresvport ( int *  alport)

◆ translate()

static void translate ( charset_t  from,
charset_t  dest,
char **  option 
)
static

Variable Documentation

◆ hostname

char hostname[MAXHOSTNAMELEN]
static

◆ lp

struct lp lp
static

◆ sat

struct sockaddr_at* sat
extern