2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
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. *
30 **************************************************************************
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.
38 * Created: Mon Sep 6 09:00 1993
41 * $XConsortium: ChkpntP.h /main/4 1995/10/26 15:18:33 rswiston $
43 * (C) Copyright 1993, Hewlett-Packard, all rights reserved.
45 **************************************************************************
48 #ifndef _Dt_Perf_Checkpoint_P_h
49 #define _Dt_Perf_Checkpoint_P_h
52 #include <X11/Xatom.h>
53 #include <X11/Intrinsic.h>
55 /*************************************************************************/
56 /************* Data types ************************************************/
57 /*************************************************************************/
59 /* The following definition is ONLY meant for union that follows */
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 */
69 #define DT_PERF_CHKPNT_MSG_SIZE (sizeof(_DtChkpntMsgFormat) / sizeof(char *))
70 /* Use the following union for actual message declaration */
72 _DtChkpntMsgFormat record;
73 char *array[DT_PERF_CHKPNT_MSG_SIZE];
76 #define DT_PERF_CHKPNT_MSG_INIT "Init"
77 #define DT_PERF_CHKPNT_MSG_CHKPNT "Chkpnt"
78 #define DT_PERF_CHKPNT_MSG_END "End"
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"
87 /* Properties attached to the client: Used for message transmission */
88 #define DT_PERF_CLIENT_CHKPNT_PROP "_DT_PERF_CHKPNT_PROP"
90 /*************************************************************************/
91 /************* Client Functions ******************************************/
92 /*************************************************************************/
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.
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 */
107 /* Send a checkpoint message to the listener */
108 extern void _DtPerfChkpntMsgSend(
109 char *message /* Acual message for transmission */
112 /* End the checkpointing message delivery */
113 extern int _DtPerfChkpntEnd(
116 /*************************************************************************/
117 /************* Listener Service Functions ********************************/
118 /*************************************************************************/
120 /* Initialize the listener */
121 extern int _DtPerfChkpntListenInit(
122 Display *display, /* Current display */
123 Window parentwin /* Parent of window associated with listener */
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 ? */
132 #endif /*_Dt_Perf_Checkpoint_h*/
133 /* Do not add anything after this endif. */