ChkpntP.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. #ifndef _Dt_Perf_Checkpoint_P_h
  48. #define _Dt_Perf_Checkpoint_P_h
  49. #include <X11/Xlib.h>
  50. #include <X11/Xatom.h>
  51. #include <X11/Intrinsic.h>
  52. /*************************************************************************/
  53. /************* Data types ************************************************/
  54. /*************************************************************************/
  55. /* The following definition is ONLY meant for union that follows */
  56. typedef struct {
  57. char *pname; /* Client program name */
  58. char *window; /* Window Id for client */
  59. char *type; /* Type of message */
  60. char *count; /* Running count of messages */
  61. char *seconds; /* Time in seconds from gettimeofday() */
  62. char *message; /* Actual message */
  63. } _DtChkpntMsgFormat;
  64. #define DT_PERF_CHKPNT_MSG_SIZE (sizeof(_DtChkpntMsgFormat) / sizeof(char *))
  65. /* Use the following union for actual message declaration */
  66. typedef union {
  67. _DtChkpntMsgFormat record;
  68. char *array[DT_PERF_CHKPNT_MSG_SIZE];
  69. } DtChkpntMsg;
  70. #define DT_PERF_CHKPNT_MSG_INIT "Init"
  71. #define DT_PERF_CHKPNT_MSG_CHKPNT "Chkpnt"
  72. #define DT_PERF_CHKPNT_MSG_END "End"
  73. /*************************************************************************/
  74. /************* Atom Names ************************************************/
  75. /*************************************************************************/
  76. /* Selection for ICCCM style interaction of client and listener*/
  77. /* This selection is owned by the listener */
  78. #define DT_PERF_CHKPNT_SEL "_DT_PERF_CHKPNT_SEL"
  79. /* Properties attached to the client: Used for message transmission */
  80. #define DT_PERF_CLIENT_CHKPNT_PROP "_DT_PERF_CHKPNT_PROP"
  81. /*************************************************************************/
  82. /************* Client Functions ******************************************/
  83. /*************************************************************************/
  84. /* Note: It is expected that users will invoke the following functions within
  85. #ifdef DT_PERFORMANCE directives. The DT_PERFORMANCE flag should be set,
  86. in the build environment, for the performance-test-enabled builds.
  87. */
  88. /* Initialize the checkpointing mechanism */
  89. extern int _DtPerfChkpntInit(
  90. Display *display, /* Display pointer */
  91. Window parentwin, /* Parent window id */
  92. char *prog_name, /* Name of the client program (argv[0]) */
  93. Boolean bChkpnt /* Boolean: True or False */
  94. );
  95. /* Send a checkpoint message to the listener */
  96. extern void _DtPerfChkpntMsgSend(
  97. char *message /* Acual message for transmission */
  98. );
  99. /* End the checkpointing message delivery */
  100. extern int _DtPerfChkpntEnd(
  101. );
  102. /*************************************************************************/
  103. /************* Listener Service Functions ********************************/
  104. /*************************************************************************/
  105. /* Initialize the listener */
  106. extern int _DtPerfChkpntListenInit(
  107. Display *display, /* Current display */
  108. Window parentwin /* Parent of window associated with listener */
  109. );
  110. /* Fetch a message from message queue */
  111. extern Bool _DtPerfChkpntMsgReceive(
  112. DtChkpntMsg *dtcp_msg, /* Above message available as a structure */
  113. Bool bBlock /* Block until a message is received ? */
  114. );
  115. #endif /*_Dt_Perf_Checkpoint_h*/
  116. /* Do not add anything after this endif. */