]>
git.ipfire.org Git - thirdparty/cups.git/blob - backend/test1284.c
2 * "$Id: test1284.c 6649 2007-07-11 21:46:42Z mike $"
4 * IEEE-1284 support functions test program for the Common UNIX Printing
7 * Copyright 2007 by Apple Inc.
8 * Copyright 1997-2006 by Easy Software Products, all rights reserved.
10 * These coded instructions, statements, and computer programs are the
11 * property of Apple Inc. and are protected by Federal copyright
12 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
13 * "LICENSE" which should have been included with this file. If this
14 * file is missing or damaged, see the license at "http://www.cups.org/".
16 * This file is subject to the Apple OS-Developed Software exception.
20 * main() - Test the device-ID functions.
24 * Include necessary headers.
27 #include <cups/string.h>
44 * 'main()' - Test the device-ID functions.
47 int /* O - Exit status */
48 main(int argc
, /* I - Number of command-line args */
49 char *argv
[]) /* I - Command-line arguments */
51 int i
, /* Looping var */
52 fd
; /* File descriptor */
53 char device_id
[1024], /* 1284 device ID string */
54 make_model
[1024], /* make-and-model string */
55 uri
[1024]; /* URI string */
60 puts("Usage: test1284 device-file [... device-file-N]");
64 for (i
= 1; i
< argc
; i
++)
66 if ((fd
= open(argv
[i
], O_RDWR
)) < 0)
72 printf("%s:\n", argv
[i
]);
74 backendGetDeviceID(fd
, device_id
, sizeof(device_id
), make_model
,
75 sizeof(make_model
), "test", uri
, sizeof(uri
));
77 printf(" device_id=\"%s\"\n", device_id
);
78 printf(" make_model=\"%s\"\n", make_model
);
79 printf(" uri=\"%s\"\n", uri
);
89 * End of "$Id: test1284.c 6649 2007-07-11 21:46:42Z mike $".