pike.git / lib / modules / Protocols.pmod / LPD.pmod

version» Context lines:

pike.git/lib/modules/Protocols.pmod/LPD.pmod:1:   // - // 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. - // 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 {    string host;    int port;    object conn;    int jobnum;    string jobtype; -  +  string jobname;       int set_job_type(string type)    {    type=lower_case(type);       switch (type) {    case "f":    case "text":    jobtype="f";    break;
pike.git/lib/modules/Protocols.pmod/LPD.pmod:29:       default:    case "l":    case "raw":    jobtype="l";    break;    }    return 1;    }    +  int set_job_name(string name) +  { +  jobname=name; +  return 1; +  } +     string|int start_queue(string queue)    {    if(!queue) return 0;       if(!conn->connect(host, port))    return 0;       conn->write(sprintf("%c%s\n", 01, queue));    string resp= conn->read();    conn->close();
pike.git/lib/modules/Protocols.pmod/LPD.pmod:59:    if(!conn->connect(host, port))    return 0;    werror("connected to " + host + "\n");       conn->write(sprintf("%c%s\n", 02, queue));    // werror("sent send data command\n");    string control="";    control+="H"+gethostname()+"\n";    control+="P"+(getpwuid(getuid())[0]||"nobody");    control+=(jobtype||"l")+"dfA"+ sprintf("%3d%s", jobnum, gethostname())+"\n"; -  +  if(jobname) +  control+="J" + jobname + "\n";    jobnum++;    conn->write(sprintf("%c%s cfA%3d%s\n", 02, (string)sizeof(control),    jobnum,gethostname()));    // werror("getting ready to send control file\n");       conn->write(sprintf("%s%c", control, 0));    // werror("sent control file\n");       conn->write(sprintf("%c%s dfA%3d%s\n", 03, (string)sizeof(job), jobnum,    gethostname()));