netatalk  4.4.0dev
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"

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)
#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)
int lp_rmjob (int job)
int lp_queue (struct papfile *out)

Variables

static char hostname [MAXHOSTNAMELEN]
struct sockaddr_atsat
static struct lp lp
char * kw_rank = "Rank"
char * kw_active = "active"
char * tag_rank = "rank: "
char * tag_owner = "owner: "
char * tag_job = "job: "
char * tag_files = "files: "
char * tag_size = "size: "
char * tag_status = "status: "

Macro Definition Documentation

◆ BUFSIZE

#define BUFSIZE   32768

◆ is_var

#define is_var ( a,
b )
Value:
(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()

void convert_octal ( char * string,
charset_t dest )
static

◆ lp_cancel()

int lp_cancel ( void )

◆ lp_close()

int lp_close ( void )

◆ lp_conn_inet()

int lp_conn_inet ( void )

◆ lp_conn_unix()

int lp_conn_unix ( void )

◆ lp_disconn_inet()

int lp_disconn_inet ( int fd)

◆ lp_disconn_unix()

int lp_disconn_unix ( int fd)

◆ lp_for()

void lp_for ( char * lpfor)

◆ lp_host()

void lp_host ( char * host)

◆ lp_init()

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 )

◆ lp_origin()

void lp_origin ( int origin)

◆ lp_person()

void lp_person ( char * person)

◆ lp_print()

int lp_print ( void )

◆ lp_queue()

int lp_queue ( struct papfile * out)

◆ lp_rmjob()

int lp_rmjob ( int job)

◆ lp_setup_comments()

void lp_setup_comments ( charset_t dest)
static

◆ lp_write()

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

◆ rresvport()

int rresvport ( int * alport)

◆ translate()

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

Variable Documentation

◆ hostname

char hostname[MAXHOSTNAMELEN]
static

◆ kw_active

char* kw_active = "active"

◆ kw_rank

char* kw_rank = "Rank"

◆ lp

struct lp lp
static

◆ sat

struct sockaddr_at* sat
extern

◆ tag_files

char* tag_files = "files: "

◆ tag_job

char* tag_job = "job: "

◆ tag_owner

char* tag_owner = "owner: "

◆ tag_rank

char* tag_rank = "rank: "

◆ tag_size

char* tag_size = "size: "

◆ tag_status

char* tag_status = "status: "