]>
git.ipfire.org Git - thirdparty/cups.git/blob - cups/testgetdests.c
2 * CUPS cupsGetDests API test program for CUPS.
4 * Copyright 2017 by Apple Inc.
6 * These coded instructions, statements, and computer programs are the
7 * property of Apple Inc. and are protected by Federal copyright
8 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
9 * which should have been included with this file. If this file is
10 * missing or damaged, see the license at "http://www.cups.org/".
12 * This file is subject to the Apple OS-Developed Software exception.
16 * Include necessary headers...
25 * 'main()' - Loop calling cupsGetDests.
28 int /* O - Exit status */
31 int num_dests
; /* Number of destinations */
32 cups_dest_t
*dests
; /* Destinations */
33 struct timeval start
, end
; /* Start and stop time */
34 double secs
; /* Total seconds to run cupsGetDests */
39 gettimeofday(&start
, NULL
);
40 num_dests
= cupsGetDests(&dests
);
41 gettimeofday(&end
, NULL
);
42 secs
= end
.tv_sec
- start
.tv_sec
+ 0.000001 * (end
.tv_usec
- start
.tv_usec
);
44 printf("Found %d printers in %.3f seconds...\n", num_dests
, secs
);
46 cupsFreeDests(num_dests
, dests
);