custom backend
Michael Sweet
mike at easysw.com
Thu Sep 1 08:37:05 PDT 2005
Meier Rudolf wrote:
> Hi
>
> I'm trying to build a custom backend for cups. It should do the same as the "socket" backend, but it should first send the string "dps", before sending the printjob.
>
> So, I took the "socket"-backend sourcecode and changed what it returns if the argc is 1 to this:
>
> puts("network socket \"dps\" \"dps backend\"");
This should be:
puts("network dps \"dps\" \"dps backend\"");
if you are installing the backend using the name "dps".
> and then, after this first if/elseif I inserted this:
>
> argv[0] = "socket://192.168.0.1:9000" to overwrite the address, because I want, that it always connects to this server (at least now).
>
> The last change I made is this: I inserted a block after the "if (argc < 7)" block which sets SIGTERM to ignore.
>
> if (send(fd, "dps", 3, 0) < 0)
> perror("ERROR: Unable to send print file to printer");
>
> Now, what happens? If I configure my printer to use the address "socket://192.168.0.1:9000" it works, but it seemes to use the standard socket backend (I don't get the "dps" string at the server). So I thought, maybe I have to change the address to "dps://192.168.0.1:9000" (for the backend itself it doesn't make a difference, since it's overwritten)... but then I get a error -> "client-error-not-possible"
>
> can someone explain me what's wrong? I thought, what I want to get shouldn't be very difficult...
>
> thanks for your help
> MR
--
______________________________________________________________________
Michael Sweet, Easy Software Products mike at easysw dot com
Internet Printing and Document Software http://www.easysw.com
More information about the cups-devel
mailing list