]>
Commit | Line | Data |
---|---|---|
fc5c09be | 1 | /* |
2 | * "$Id$" | |
3 | * | |
4 | * IEEE-1284 support functions test program for the Common UNIX Printing | |
5 | * System (CUPS). | |
6 | * | |
24c1b5ce | 7 | * Copyright 1997-2006 by Easy Software Products, all rights reserved. |
fc5c09be | 8 | * |
9 | * These coded instructions, statements, and computer programs are the | |
10 | * property of Easy Software Products and are protected by Federal | |
11 | * copyright law. Distribution and use rights are outlined in the file | |
12 | * "LICENSE" which should have been included with this file. If this | |
13 | * file is missing or damaged please contact Easy Software Products | |
14 | * at: | |
15 | * | |
16 | * Attn: CUPS Licensing Information | |
17 | * Easy Software Products | |
18 | * 44141 Airport View Drive, Suite 204 | |
19 | * Hollywood, Maryland 20636 USA | |
20 | * | |
21 | * Voice: (301) 373-9600 | |
22 | * EMail: cups-info@cups.org | |
23 | * WWW: http://www.cups.org | |
24 | * | |
25 | * This file is subject to the Apple OS-Developed Software exception. | |
26 | * | |
27 | * Contents: | |
28 | * | |
ff0295f0 | 29 | * main() - Test the device-ID functions. |
fc5c09be | 30 | */ |
31 | ||
32 | /* | |
33 | * Include necessary headers. | |
34 | */ | |
35 | ||
36 | #include <cups/string.h> | |
37 | #include <stdlib.h> | |
38 | #include <errno.h> | |
39 | #ifdef WIN32 | |
40 | # include <io.h> | |
41 | #else | |
42 | # include <unistd.h> | |
43 | # include <fcntl.h> | |
44 | #endif /* WIN32 */ | |
43b5ad0d | 45 | |
fc5c09be | 46 | #define DEBUG |
47 | #include "ieee1284.c" | |
48 | ||
49 | ||
50 | /* | |
51 | * 'main()' - Test the device-ID functions. | |
52 | */ | |
53 | ||
54 | int /* O - Exit status */ | |
55 | main(int argc, /* I - Number of command-line args */ | |
56 | char *argv[]) /* I - Command-line arguments */ | |
57 | { | |
58 | int i, /* Looping var */ | |
59 | fd; /* File descriptor */ | |
60 | char device_id[1024], /* 1284 device ID string */ | |
61 | make_model[1024], /* make-and-model string */ | |
62 | uri[1024]; /* URI string */ | |
63 | ||
64 | ||
65 | if (argc < 2) | |
66 | { | |
67 | puts("Usage: test1284 device-file [... device-file-N]"); | |
68 | exit(1); | |
69 | } | |
70 | ||
71 | for (i = 1; i < argc; i ++) | |
72 | { | |
73 | if ((fd = open(argv[i], O_RDWR)) < 0) | |
74 | { | |
75 | perror(argv[i]); | |
76 | return (errno); | |
77 | } | |
78 | ||
79 | printf("%s:\n", argv[i]); | |
80 | ||
43b5ad0d | 81 | backendGetDeviceID(fd, device_id, sizeof(device_id), make_model, |
82 | sizeof(make_model), "test", uri, sizeof(uri)); | |
fc5c09be | 83 | |
84 | printf(" device_id=\"%s\"\n", device_id); | |
85 | printf(" make_model=\"%s\"\n", make_model); | |
86 | printf(" uri=\"%s\"\n", uri); | |
87 | ||
88 | close(fd); | |
89 | } | |
90 | ||
91 | return (0); | |
92 | } | |
93 | ||
94 | ||
95 | /* | |
96 | * End of "$Id$". | |
97 | */ |