Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #225367
| From | Nicolas George <george@nsup.org> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: SANE default scanner |
| Date | 2020-07-27 19:20 +0200 |
| Message-ID | <AxeX7-sR-1@gated-at.bofh.it> (permalink) |
| References | (5 earlier) <AxdeG-7Pd-23@gated-at.bofh.it> <AxdRo-8i6-17@gated-at.bofh.it> <Axekq-8rR-19@gated-at.bofh.it> <Axeu7-8vj-9@gated-at.bofh.it> <AxeNr-pw-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
[Multipart message — attachments visible in raw view] - view raw
Brian (12020-07-27):
> Ok, libsane-hpaio requires libcups.so.2. That's nowhere near requiring
> CUPS, in particular cups-daemon. The printing system is not involved
> with scanning.
This is the last time I grace you with a reply. As I have told you twice
now, unlike you, I have read the source code and I know what I am
talking about. Here are the excerpts:
/* Look for Network Scan devices if localonly flag if FALSE. */
if (!localOnly)
{
/* Look for all-in-one scan devices for which print queue created */
cnt = GetCupsPrinters(&cups_printer);
for (i=0; i<cnt; i++)
{
total += AddDevice(cups_printer[i]);
free(cups_printer[i]);
}
and:
static int GetCupsPrinters(char ***printer)
{
http_t *http=NULL; /* HTTP object */
ipp_t *request=NULL; /* IPP request object */
ipp_t *response=NULL; /* IPP response object */
ipp_attribute_t *attr; /* Current IPP attribute */
int cnt=0;
/* Connect to the HTTP server */
if ((http = httpConnectEncrypt(cupsServer(), ippPort(), cupsEncryption())) == NULL)
goto bugout;
/* Assemble the IPP request */
request = ippNew();
ippSetOperation( request, CUPS_GET_PRINTERS );
ippSetRequestId( request, 1 );
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8");
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, "en");
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "requested-attributes", NULL, "device-uri");
/* Send the request and get a response. */
if ((response = cupsDoRequest(http, request, "/")) == NULL)
goto bugout;
for (attr = ippFirstAttribute ( response ); attr != NULL; attr = ippNextAttribute( response ))
{
/* Skip leading attributes until we hit a printer. */
while (attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER)
attr = ippNextAttribute( response );
if (attr == NULL)
break;
while (attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER)
{
if (strcmp(ippGetName( attr ), "device-uri") == 0 && ippGetValueTag( attr ) == IPP_TAG_URI && AddCupsList(ippGetString( attr, 0, NULL ), printer) == 0)
cnt++;
attr = ippNextAttribute( response );
}
if (attr == NULL)
break;
}
ippDelete(response);
bugout:
return cnt;
}
Regards,
--
Nicolas George
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
SANE default scanner Nicolas George <george@nsup.org> - 2020-07-27 12:00 +0200
Re: SANE default scanner Georgi Naplatanov <gosho@oles.biz> - 2020-07-27 14:00 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-27 14:50 +0200
Re: SANE default scanner Brian <ad44@cityscape.co.uk> - 2020-07-27 15:00 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-27 15:00 +0200
Re: SANE default scanner Brian <ad44@cityscape.co.uk> - 2020-07-27 15:30 +0200
Re: SANE default scanner Hans <hans.ullrich@loop.de> - 2020-07-27 15:10 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-27 15:30 +0200
Re: SANE default scanner Georgi Naplatanov <gosho@oles.biz> - 2020-07-27 15:10 +0200
Re: SANE default scanner Reco <recoverym4n@enotuniq.net> - 2020-07-27 15:30 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-27 15:40 +0200
Re: SANE default scanner Brian <ad44@cityscape.co.uk> - 2020-07-27 16:00 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-27 16:30 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-27 17:40 +0200
Re: SANE default scanner Brian <ad44@cityscape.co.uk> - 2020-07-27 18:10 +0200
Re: SANE default scanner Brian <ad44@cityscape.co.uk> - 2020-07-27 17:40 +0200
Re: SANE default scanner Georgi Naplatanov <gosho@oles.biz> - 2020-07-27 16:50 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-27 17:00 +0200
Re: SANE default scanner Stefan Monnier <monnier@iro.umontreal.ca> - 2020-07-27 17:20 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-27 17:30 +0200
Re: SANE default scanner Stefan Monnier <monnier@iro.umontreal.ca> - 2020-07-27 18:10 +0200
Re: SANE default scanner Stefan Monnier <monnier@iro.umontreal.ca> - 2020-07-27 18:40 +0200
Re: SANE default scanner Brian <ad44@cityscape.co.uk> - 2020-07-27 19:20 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-27 18:40 +0200
Re: SANE default scanner Stefan Monnier <monnier@iro.umontreal.ca> - 2020-07-27 23:10 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-28 00:00 +0200
Re: SANE default scanner Stefan Monnier <monnier@iro.umontreal.ca> - 2020-07-28 00:30 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-28 14:20 +0200
Re: SANE default scanner Stefan Monnier <monnier@iro.umontreal.ca> - 2020-07-28 16:20 +0200
Re: SANE default scanner Brian <ad44@cityscape.co.uk> - 2020-07-28 21:30 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-29 11:20 +0200
Re: SANE default scanner <tomas@tuxteam.de> - 2020-07-29 12:10 +0200
Re: SANE default scanner Brian <ad44@cityscape.co.uk> - 2020-07-29 20:30 +0200
Re: SANE default scanner <tomas@tuxteam.de> - 2020-07-29 21:40 +0200
Re: SANE default scanner <tomas@tuxteam.de> - 2020-07-28 09:40 +0200
Re: SANE default scanner Brian <ad44@cityscape.co.uk> - 2020-07-27 18:40 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-27 18:50 +0200
Re: SANE default scanner Brian <ad44@cityscape.co.uk> - 2020-07-27 19:10 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-27 19:20 +0200
Re: SANE default scanner Brian <ad44@cityscape.co.uk> - 2020-07-27 20:00 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-27 19:40 +0200
Re: SANE default scanner Brian <ad44@cityscape.co.uk> - 2020-07-28 14:20 +0200
Re: SANE default scanner Brian <ad44@cityscape.co.uk> - 2020-07-27 20:40 +0200
Re: SANE default scanner Brian <ad44@cityscape.co.uk> - 2020-07-27 21:20 +0200
Re: SANE default scanner Gene Heskett <gheskett@shentel.net> - 2020-07-27 21:20 +0200
Re: SANE default scanner John Boxall <jboxall47@gmail.com> - 2020-07-27 15:30 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-27 15:40 +0200
Re: SANE default scanner Liam O'Toole <liam.p.otoole@gmail.com> - 2020-07-29 00:00 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-07-27 19:40 +0200
Re: SANE default scanner Siard <shiems@mailbox.org> - 2020-07-27 20:00 +0200
Re: SANE default scanner Siard <shiems@mailbox.org> - 2020-07-27 19:40 +0200
Re: SANE default scanner George Shuklin <george.shuklin@gmail.com> - 2020-08-07 17:20 +0200
Re: SANE default scanner Nicolas George <george@nsup.org> - 2020-08-07 17:30 +0200
csiph-web