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