]>
git.ipfire.org Git - thirdparty/cups.git/blob - backend/test1284.c
2 * IEEE-1284 support functions test program for CUPS.
4 * Copyright © 2007-2010 by Apple Inc.
5 * Copyright © 1997-2006 by Easy Software Products, all rights reserved.
7 * Licensed under Apache License v2.0. See the file "LICENSE" for more
12 * Include necessary headers.
15 #include <cups/string-private.h>
27 * 'main()' - Test the device-ID functions.
30 int /* O - Exit status */
31 main(int argc
, /* I - Number of command-line args */
32 char *argv
[]) /* I - Command-line arguments */
34 int i
, /* Looping var */
35 fd
; /* File descriptor */
36 char device_id
[1024], /* 1284 device ID string */
37 make_model
[1024], /* make-and-model string */
38 uri
[1024]; /* URI string */
43 puts("Usage: test1284 device-file [... device-file-N]");
47 for (i
= 1; i
< argc
; i
++)
49 if ((fd
= open(argv
[i
], O_RDWR
)) < 0)
55 printf("%s:\n", argv
[i
]);
57 backendGetDeviceID(fd
, device_id
, sizeof(device_id
), make_model
,
58 sizeof(make_model
), "test", uri
, sizeof(uri
));
60 printf(" device_id=\"%s\"\n", device_id
);
61 printf(" make_model=\"%s\"\n", make_model
);
62 printf(" uri=\"%s\"\n", uri
);