Module Lpd
module Lpd: sig
.. end
LPD protocol server library (RFC 1179 compliant).
Author(s): Christophe Troestler
Types describing a print job
type
banner = {
|
user_name : string ; |
|
class_name : string ; |
|
job_name : string ; |
}
Informations for a banner page.
type
file_type =
| |
Text of int * int |
| |
Bin |
| |
PS |
| |
DVI |
| |
Troff of string * string * string * string |
| |
Ditroff |
| |
CIF |
| |
Plot |
| |
Pr of string * int |
| |
Fortran |
| |
Raster |
Information on the type of the file to be printed.
type
file = {
|
name : string ; |
|
size : int ; |
|
nbcopies : int ; |
|
storage : string ; |
|
of_type : file_type ; |
}
type
job = {
|
number : int ; |
|
user : string ; |
|
host : string ; |
|
mailto : string ; |
|
banner : banner option ; |
|
files : file list ; |
|
addr : Unix.sockaddr ; |
}
Module specifying the daemon behavior
type
jobref =
| |
User of string |
| |
Num of int |
type
queue_actions = {
}
Functions to be executed on queue events.
module type CONFIG = sig
.. end
module Make:
Make a Line Printer daemon according to the configuration C
.
Useful functions
val string_of_current_time : unit -> string
string_of_current_time()
returns the current date and time.
val header_of_job : string -> string
header_of_job queue
returns a string suitable as a header for
Lpd.string_of_job
. If
queue = ""
, the mention of the queue
is omitted.
val string_of_job : int -> job -> string
string_of_job rank job
returns a one line string describing
the
job
. A job with an empty list of files is considered to
have been canceled. The
rank
is a positive number giving the
rank of the job in the queue. A
rank
if
0
means that the
job is in the printing stage.
string_of_job
is a helper
function to design a
send_queue
callback (see
Lpd.queue_actions
).
val long_string_of_job : int -> job -> string
long_string_of_job rank job
does the same as
Lpd.string_of_job
except that the description is in long
format (multi-lines). It is suitable to write
send_queue_long
callback (see
Lpd.queue_actions
).
val any_host : Unix.sockaddr -> bool
any_host addr
accepts any Internet host which can be found in
the DNS.
val these_hosts : ?file:string -> string list -> Unix.sockaddr -> bool
these_hosts ?file hosts adrr
accepts connections from Internet
hosts or IP addresses listed in the file or in the list hosts
.
file
: filename containing a list of hosts to authorize
separated with white space, tabulations, or newlines. Blanks
lines are ignored. Comments start with '#' and last till the
end of the line.