#include "midas.h"
#include "msystem.h"
Go to the source code of this file.
◆ main()
Definition at line 27 of file msgdump.c.
28{
30 char event[10000];
36
38 printf(
"Usage: msgdump [-dwc] \n");
40 printf(
" -d display messages on screen \n");
41 printf(
" -c display clients producing messages \n");
42 printf(
" -w write messages to MSGDUMP.ASC \n\n");
43 return 1;
44 }
45
48 return 1;
49
51
53
55
58
59 if (
argv[1][1] ==
'd') {
60 printf(
"Displaying messages. Hit Ctrl-C to abort.\n");
61 printf(
"=========================================\n\n");
62
63 do {
64 size = 10000;
66
68 printf(
"Error receiving event.\n");
69 return 0;
70 }
71
73 for (
i = 0;
i < 8;
i++)
76
77 printf(
"serial %d, type %s, time %1.3lf\n",
80 } while (1);
81 }
82
83 if (
argv[1][1] ==
'c') {
84 printf(
"Clients attached to current message system:\n");
85 printf(
"===========================================\n\n");
86
91 }
92
93 if (
argv[1][1] ==
'w') {
94 printf(
"Message collecting active, hit ENTER to stop.\n");
95
97
98 printf(
"Writing MSGDUMP.ASC ...\n");
99
100 f =
fopen(
"MSGDUMP.ASC",
"w");
101
103
104 do {
105 size = 10000;
109 break;
110 }
111
113 for (
i = 0;
i < 8;
i++)
116
117 fprintf(f,
"serial %d, type %s, time %1.3lf\n",
120 } while (1);
121 }
122
123
125 return 1;
126}
INT bm_open_buffer(const char *buffer_name, INT buffer_size, INT *buffer_handle)
INT bm_request_event(HNDLE buffer_handle, short int event_id, short int trigger_mask, INT sampling_type, HNDLE *request_id, EVENT_HANDLER *func)
INT bm_receive_event(INT buffer_handle, void *destination, INT *buf_size, int timeout_msec)
INT cm_connect_experiment(const char *host_name, const char *exp_name, const char *client_name, void(*func)(char *))
INT cm_disconnect_experiment(void)
#define MESSAGE_BUFFER_NAME
#define MESSAGE_BUFFER_SIZE
INT bm_get_buffer_info(INT buffer_handle, BUFFER_HEADER *buffer_header)
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
BUFFER_CLIENT client[MAX_CLIENTS]
◆ type_name
Initial value:= {
"ERROR",
"INFO",
"DEBUG" "USER",
"LOG",
"TALK",
"CALL",
}
Definition at line 18 of file msgdump.c.
18 {
19 "ERROR",
20 "INFO",
21 "DEBUG" "USER",
22 "LOG",
23 "TALK",
24 "CALL",
25};