]> git.ipfire.org Git - thirdparty/cups.git/blob - backend/test1284.c
Remove all of the Subversion keywords from various source files.
[thirdparty/cups.git] / backend / test1284.c
1 /*
2 * IEEE-1284 support functions test program for CUPS.
3 *
4 * Copyright 2007-2010 by Apple Inc.
5 * Copyright 1997-2006 by Easy Software Products, all rights reserved.
6 *
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/".
12 *
13 * This file is subject to the Apple OS-Developed Software exception.
14 */
15
16 /*
17 * Include necessary headers.
18 */
19
20 #include <cups/string-private.h>
21 #ifdef WIN32
22 # include <io.h>
23 #else
24 # include <unistd.h>
25 # include <fcntl.h>
26 #endif /* WIN32 */
27
28 #include "ieee1284.c"
29
30
31 /*
32 * 'main()' - Test the device-ID functions.
33 */
34
35 int /* O - Exit status */
36 main(int argc, /* I - Number of command-line args */
37 char *argv[]) /* I - Command-line arguments */
38 {
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 */
44
45
46 if (argc < 2)
47 {
48 puts("Usage: test1284 device-file [... device-file-N]");
49 exit(1);
50 }
51
52 for (i = 1; i < argc; i ++)
53 {
54 if ((fd = open(argv[i], O_RDWR)) < 0)
55 {
56 perror(argv[i]);
57 return (errno);
58 }
59
60 printf("%s:\n", argv[i]);
61
62 backendGetDeviceID(fd, device_id, sizeof(device_id), make_model,
63 sizeof(make_model), "test", uri, sizeof(uri));
64
65 printf(" device_id=\"%s\"\n", device_id);
66 printf(" make_model=\"%s\"\n", make_model);
67 printf(" uri=\"%s\"\n", uri);
68
69 close(fd);
70 }
71
72 return (0);
73 }