]>
git.ipfire.org Git - thirdparty/cups.git/blob - backend/test1284.c
85ac8b5b3464f657d5ed18b502ffb313785f16ae
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 * These coded instructions, statements, and computer programs are the
8 * property of Apple Inc. and are protected by Federal copyright
9 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 * "LICENSE" which should have been included with this file. If this
11 * file is missing or damaged, see the license at "http://www.cups.org/".
13 * This file is subject to the Apple OS-Developed Software exception.
17 * Include necessary headers.
20 #include <cups/string-private.h>
32 * 'main()' - Test the device-ID functions.
35 int /* O - Exit status */
36 main(int argc
, /* I - Number of command-line args */
37 char *argv
[]) /* I - Command-line arguments */
39 int i
, /* Looping var */
40 fd
; /* File descriptor */
41 char device_id
[1024], /* 1284 device ID string */
42 make_model
[1024], /* make-and-model string */
43 uri
[1024]; /* URI string */
48 puts("Usage: test1284 device-file [... device-file-N]");
52 for (i
= 1; i
< argc
; i
++)
54 if ((fd
= open(argv
[i
], O_RDWR
)) < 0)
60 printf("%s:\n", argv
[i
]);
62 backendGetDeviceID(fd
, device_id
, sizeof(device_id
), make_model
,
63 sizeof(make_model
), "test", uri
, sizeof(uri
));
65 printf(" device_id=\"%s\"\n", device_id
);
66 printf(" make_model=\"%s\"\n", make_model
);
67 printf(" uri=\"%s\"\n", uri
);