]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/uctf/tst.printtype.c
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / cddl / contrib / opensolaris / cmd / dtrace / test / tst / common / uctf / tst.printtype.c
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11
12 /*
13  * Copyright 2013 (c) Joyent, Inc. All rights reserved.
14  */
15
16 /*
17  * The point of this is to use print() on various functions to make sure that we
18  * can print basic structures. Note that we purposefully are making sure that
19  * there are no pointers here.
20  */
21 #include <unistd.h>
22
23 typedef struct final_fantasy_info {
24         int ff_gameid;
25         int ff_partysize;
26         int ff_hassummons;
27 } final_fantasy_info_t;
28
29 static int
30 ff_getgameid(final_fantasy_info_t *f)
31 {
32         return (0);
33 }
34
35 static int
36 ff_getpartysize(final_fantasy_info_t *f)
37 {
38         return (0);
39 }
40
41 static int
42 ff_getsummons(final_fantasy_info_t *f)
43 {
44         return (0);
45 }
46
47 int
48 main(void)
49 {
50         final_fantasy_info_t ffiii, ffx, ffi;
51
52         ffi.ff_gameid = 1;
53         ffi.ff_partysize = 4;
54         ffi.ff_hassummons = 0;
55
56         ffiii.ff_gameid = 6;
57         ffiii.ff_partysize = 4;
58         ffiii.ff_hassummons = 1;
59
60         ffx.ff_gameid = 10;
61         ffx.ff_partysize = 3;
62         ffx.ff_hassummons = 1;
63
64         for (;;) {
65                 ff_getgameid(&ffi);
66                 ff_getpartysize(&ffx);
67                 ff_getsummons(&ffiii);
68                 sleep(1);
69         }
70         /*NOTREACHED*/
71         return (0);
72 }