Integrate top-level .gitignore into .gitignore for each subdirectory
[free-sw/xcb/demo] / dpms.c
1 /*
2  * Copyright (C) 2001-2005 Bart Massey and Jamey Sharp.
3  * All Rights Reserved.  See the file COPYING in this directory
4  * for licensing information.
5  */
6
7 #include <X11/XCB/xcb.h>
8 #include <X11/XCB/dpms.h>
9 #include <assert.h>
10 #include <stdlib.h>
11 #include <stdio.h>
12
13 int main(int argc, char **argv)
14 {
15         XCBConnection *c = XCBConnect(0, 0);
16         XCBDPMSGetVersionCookie vc;
17         XCBDPMSGetVersionRep *ver;
18         XCBDPMSCapableCookie cc;
19         XCBDPMSCapableRep *cap;
20         XCBDPMSGetTimeoutsCookie tc;
21         XCBDPMSGetTimeoutsRep *time;
22
23         XCBPrefetchExtensionData(c, &XCBDPMSId);
24
25         vc = XCBDPMSGetVersion(c, 1, 1);
26         cc = XCBDPMSCapable(c);
27         tc = XCBDPMSGetTimeouts(c);
28
29         ver = XCBDPMSGetVersionReply(c, vc, 0);
30         cap = XCBDPMSCapableReply(c, cc, 0);
31         time = XCBDPMSGetTimeoutsReply(c, tc, 0);
32
33         assert(ver);
34         assert(ver->server_major_version == 1);
35         assert(ver->server_minor_version == 1);
36         free(ver);
37
38         assert(cap);
39         assert(cap->capable);
40         free(cap);
41
42         assert(time);
43         printf("Standby: %d\n" "Suspend: %d\n" "Off: %d\n",
44                 time->standby_timeout, time->suspend_timeout, time->off_timeout);
45         free(time);
46
47         XCBDisconnect(c);
48
49         exit(0);
50         /*NOTREACHED*/
51 }