Fix warnings on FreeBSD
[oweals/cde.git] / cde / lib / DtSvc / DtUtil2 / ChkpntP.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these libraries and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23 /*
24  * (c) Copyright 1993, 1994 Hewlett-Packard Company                     *
25  * (c) Copyright 1993, 1994 International Business Machines Corp.       *
26  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.                      *
27  * (c) Copyright 1993, 1994 Novell, Inc.                                *
28  */
29 /* -*-C-*-
30 **************************************************************************
31 *
32 * File:         Chkpnt.h
33 * Description:  CDE Private header file. Private API for sending checkpoint
34 *               messages between compliant clients and the checkpoint service
35 *               provider. This API is designed for use by performance
36 *               measurement programs.
37 *
38 * Created:      Mon Sep  6 09:00 1993
39 * Language:     C
40 *
41 * $XConsortium: ChkpntP.h /main/4 1995/10/26 15:18:33 rswiston $
42 *
43 * (C) Copyright 1993, Hewlett-Packard, all rights reserved.
44 *
45 **************************************************************************
46 */
47
48 #ifndef _Dt_Perf_Checkpoint_P_h
49 #define _Dt_Perf_Checkpoint_P_h
50
51 #include <X11/Xlib.h>
52 #include <X11/Xatom.h>
53 #include <X11/Intrinsic.h>
54
55 /*************************************************************************/
56 /************* Data types ************************************************/
57 /*************************************************************************/
58
59 /* The following definition is ONLY meant for union that follows */
60 typedef struct {
61     char        *pname;         /* Client program name                  */
62     char        *window;        /* Window Id for client                 */
63     char        *type;          /* Type of message                      */
64     char        *count;         /* Running count of messages            */
65     char        *seconds;       /* Time in seconds from gettimeofday()  */
66     char        *message;       /* Actual message                       */
67 } _DtChkpntMsgFormat;
68
69 #define DT_PERF_CHKPNT_MSG_SIZE (sizeof(_DtChkpntMsgFormat) / sizeof(char *))
70 /* Use the following union for actual message declaration */
71 typedef union {
72     _DtChkpntMsgFormat record;
73     char               *array[DT_PERF_CHKPNT_MSG_SIZE];
74 } DtChkpntMsg;
75
76 #define DT_PERF_CHKPNT_MSG_INIT         "Init"
77 #define DT_PERF_CHKPNT_MSG_CHKPNT       "Chkpnt"
78 #define DT_PERF_CHKPNT_MSG_END          "End"
79
80 /*************************************************************************/
81 /************* Atom Names ************************************************/
82 /*************************************************************************/
83 /* Selection for ICCCM style interaction of client and listener*/
84 /* This selection is owned by the listener */
85 #define DT_PERF_CHKPNT_SEL              "_DT_PERF_CHKPNT_SEL"
86
87 /* Properties attached to the client: Used for message transmission */
88 #define DT_PERF_CLIENT_CHKPNT_PROP      "_DT_PERF_CHKPNT_PROP"
89
90 /*************************************************************************/
91 /************* Client Functions ******************************************/
92 /*************************************************************************/
93
94 /* Note: It is expected that users will invoke the following functions within
95    #ifdef DT_PERFORMANCE directives. The DT_PERFORMANCE flag should be set,
96    in the build environment, for the performance-test-enabled builds.
97 */
98
99 /* Initialize the checkpointing mechanism */
100 extern int _DtPerfChkpntInit(
101     Display        *display,       /* Display pointer                      */
102     Window         parentwin,      /* Parent window id                     */
103     char           *prog_name,     /* Name of the client program (argv[0]) */
104     Boolean        bChkpnt         /* Boolean: True or False               */
105 );
106
107 /* Send a checkpoint message to the listener */
108 extern void _DtPerfChkpntMsgSend(
109     char           *message        /* Acual message for transmission     */
110 );
111
112 /* End the checkpointing message delivery */
113 extern int _DtPerfChkpntEnd(
114 );
115
116 /*************************************************************************/
117 /************* Listener Service Functions ********************************/
118 /*************************************************************************/
119
120 /* Initialize the listener */
121 extern int _DtPerfChkpntListenInit(
122     Display *display,   /* Current display */
123     Window parentwin    /* Parent of window associated with listener */
124 );
125
126 /* Fetch a message from message queue */
127 extern Bool _DtPerfChkpntMsgReceive(
128 DtChkpntMsg *dtcp_msg,          /* Above message available as a structure */
129 Bool        bBlock              /* Block until a message is received ?    */
130 );
131
132 #endif /*_Dt_Perf_Checkpoint_h*/
133 /* Do not add anything after this endif. */