Skip to content
Snippets Groups Projects
Commit 4505feed authored by H. William Welliver III's avatar H. William Welliver III Committed by Henrik (Grubba) Grubbström
Browse files

Updated to the 1998-07-03 version. Thanks, Bill Welliver <hww3@riverweb.com>.

Now allows setting of the "Job Name".

Rev: lib/modules/Protocols.pmod/LPD.pmod:1.3
parent 93f544f4
No related branches found
No related tags found
No related merge requests found
...@@ -38,6 +38,7 @@ testfont binary ...@@ -38,6 +38,7 @@ testfont binary
/lib/modules/LR.pmod/scanner.pike foreign_ident /lib/modules/LR.pmod/scanner.pike foreign_ident
/lib/modules/MIME.pmod foreign_ident /lib/modules/MIME.pmod foreign_ident
/lib/modules/Protocols.pmod/Ident.pmod foreign_ident /lib/modules/Protocols.pmod/Ident.pmod foreign_ident
/lib/modules/Protocols.pmod/LPD.pmod foreign_ident
/lib/modules/Protocols.pmod/Line.pmod foreign_ident /lib/modules/Protocols.pmod/Line.pmod foreign_ident
/lib/modules/Protocols.pmod/Ports.pmod foreign_ident /lib/modules/Protocols.pmod/Ports.pmod foreign_ident
/lib/modules/Protocols.pmod/TELNET.pmod foreign_ident /lib/modules/Protocols.pmod/TELNET.pmod foreign_ident
......
// //
// LPD.pmod: an implimentation of the BSD lpd protocol // LPD.pmod: an implementation of the BSD lpd protocol (RFC 1179).
// This is a module for pike. // This is a module for pike.
// 3 April 1998 <hww3@riverweb.com> Bill Welliver // 3 July 1998 <hww3@riverweb.com> Bill Welliver
//
// $Id: LPD.pmod,v 1.3 1998/07/03 20:30:19 grubba Exp $
// //
class client { class client {
...@@ -10,6 +12,7 @@ class client { ...@@ -10,6 +12,7 @@ class client {
object conn; object conn;
int jobnum; int jobnum;
string jobtype; string jobtype;
string jobname;
int set_job_type(string type) int set_job_type(string type)
{ {
...@@ -36,6 +39,12 @@ class client { ...@@ -36,6 +39,12 @@ class client {
return 1; return 1;
} }
int set_job_name(string name)
{
jobname=name;
return 1;
}
string|int start_queue(string queue) string|int start_queue(string queue)
{ {
if(!queue) return 0; if(!queue) return 0;
...@@ -66,7 +75,8 @@ class client { ...@@ -66,7 +75,8 @@ class client {
control+="H"+gethostname()+"\n"; control+="H"+gethostname()+"\n";
control+="P"+(getpwuid(getuid())[0]||"nobody"); control+="P"+(getpwuid(getuid())[0]||"nobody");
control+=(jobtype||"l")+"dfA"+ sprintf("%3d%s", jobnum, gethostname())+"\n"; control+=(jobtype||"l")+"dfA"+ sprintf("%3d%s", jobnum, gethostname())+"\n";
if(jobname)
control+="J" + jobname + "\n";
jobnum++; jobnum++;
conn->write(sprintf("%c%s cfA%3d%s\n", 02, (string)sizeof(control), conn->write(sprintf("%c%s cfA%3d%s\n", 02, (string)sizeof(control),
jobnum,gethostname())); jobnum,gethostname()));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment