]>
git.ipfire.org Git - thirdparty/cups.git/blob - backend/test1284.c
4 * IEEE-1284 support functions test program for CUPS.
6 * Copyright 2007-2010 by Apple Inc.
7 * Copyright 1997-2006 by Easy Software Products, all rights reserved.
9 * These coded instructions, statements, and computer programs are the
10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * "LICENSE" which should have been included with this file. If this
13 * file is missing or damaged, see the license at "http://www.cups.org/".
15 * This file is subject to the Apple OS-Developed Software exception.
19 * main() - Test the device-ID functions.
23 * Include necessary headers.
26 #include <cups/string-private.h>
38 * 'main()' - Test the device-ID functions.
41 int /* O - Exit status */
42 main(int argc
, /* I - Number of command-line args */
43 char *argv
[]) /* I - Command-line arguments */
45 int i
, /* Looping var */
46 fd
; /* File descriptor */
47 char device_id
[1024], /* 1284 device ID string */
48 make_model
[1024], /* make-and-model string */
49 uri
[1024]; /* URI string */
54 puts("Usage: test1284 device-file [... device-file-N]");
58 for (i
= 1; i
< argc
; i
++)
60 if ((fd
= open(argv
[i
], O_RDWR
)) < 0)
66 printf("%s:\n", argv
[i
]);
68 backendGetDeviceID(fd
, device_id
, sizeof(device_id
), make_model
,
69 sizeof(make_model
), "test", uri
, sizeof(uri
));
71 printf(" device_id=\"%s\"\n", device_id
);
72 printf(" make_model=\"%s\"\n", make_model
);
73 printf(" uri=\"%s\"\n", uri
);