module Lpd:LPD protocol server library (RFC 1179 compliant).sig..end
type banner = {
|
user_name : |
(* | User name for the banner page. | *) |
|
class_name : |
(* | Class name, conventionally used to display the host from which the printing job originated. | *) |
|
job_name : |
(* | Job name, conventionally used to display the name of the file or files which were "printed". | *) |
type file_type =
| |
Text of |
(* | Text(indent, number_of_columns): print as a text file,
providing page breaks as necessary. According to the RFC,
any ASCII control chars other than '\b', '\t', '\n', '\012',
'\r' should be discarded -- it is your task to do so as you
know better how to deal with them (accented letters,...)
especially when you know PDF files may be sent using that type! | *) |
| |
Bin |
(* | Binary file to be printed as is (including control chars). | *) |
| |
PS |
(* | PostScript file. | *) |
| |
DVI |
(* | TeX DVI file. | *) |
| |
Troff of |
(* | Troff(R font, I font, B font, S font): troff output file. | *) |
| |
Ditroff |
(* | ditroff (device independent troff) output. | *) |
| |
CIF |
(* | CalTech Intermediate Form graphics language. | *) |
| |
Plot |
(* | Output from the Berkeley Unix plot library. | *) |
| |
Pr of |
(* | Pr(title, number_of_columns): print with a heading, page
numbers, and pagination. The heading should include the
date and time that printing was started, the title, and a
page number identifier followed by the page number. | *) |
| |
Fortran |
(* | Print interpreting the first column of each line as FORTRAN carriage control. | *) |
| |
Raster |
(* | Sun raster format file. | *) |
type file = {
|
name : |
(* | Name of the file on the client machine.
"" means standard input. | *) |
|
size : |
(* | Size in bytes of the file. | *) |
|
nbcopies : |
(* | Number of copies requested. | *) |
|
storage : |
(* | Local file on the disk holding the data. | *) |
|
of_type : |
(* | Type of the file. | *) |
type job = {
|
number : |
(* | Three digits job number. A negative number indicates that the client did not send a correct job number. | *) |
|
user : |
(* | User identification of the entity requesting the printing job. | *) |
|
host : |
(* | Host which is to be treated as the source of the print job. This is not necessarily the same as the machine which connected this server -- the job may have been routed through several computers. | *) |
|
mailto : |
(* | If different from "", request that a mail be sent to the given
address when the printing operation ends (successfully or
unsuccessfully). There is no guarantee that the email address
is even well formed (e.g. it may only be the login name). | *) |
|
banner : |
(* | Possible banner page. | *) |
|
files : |
(* | List of files of this job. The files will be removed after the
job handling function on_reception return. If you want to
keep them longer, rename them or (better) move them to another
directory. | *) |
|
addr : |
(* | Address of the machine which connected to this server. | *) |
type jobref =
| |
User of |
(* | Reference all jobs of the given user | *) |
| |
Num of |
(* | Reference the job with the given number | *) |
type queue_actions = {
|
print : |
(* | Function executed when it is requested to start the printing process (if not already running). | *) |
|
on_reception : |
(* | Handler for each job received. | *) |
|
send_queue : |
(* | Handler for sending a queue state in short form. | *) |
|
send_queue_long : |
(* | Handler for sending a queue state in long form. | *) |
|
remove : |
(* | Handler for removing jobs. The string is the user name (the
agent) requesting the removal and Unix.sockaddr is the address
of the machine which connected the server (to enable security
checks). lprm -, requesting to remove all the jobs that the
user owns, gives as a list of jobs: [User "-"]. | *) |
module type CONFIG =sig..end
module Make:
C.
val string_of_current_time : unit -> stringstring_of_current_time() returns the current date and time.val header_of_job : string -> stringheader_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 -> stringstring_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 -> stringlong_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 -> boolany_host addr accepts any Internet host which can be found in
the DNS.val these_hosts : ?file:string -> string list -> Unix.sockaddr -> boolthese_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 and IP addresses
to authorize separated with white space, tabulations, or
newlines. Blanks lines are ignored. Comments start with '#'
and last till the end of the line.