GSI Object Oriented Online Offline (Go4)  GO4-5.3.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
f_mbs_status.c
Go to the documentation of this file.
1 // $Id: f_mbs_status.c 1202 2014-05-09 07:07:18Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum für Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #include "typedefs.h"
15 #include <stdio.h>
16 #include <errno.h>
17 #include <string.h>
18 #include <sys/types.h>
19 #include <ctype.h>
20 #include <stdlib.h>
21 #include "sbs_def.h"
22 #include "sys_def.h"
23 #include "ml_def.h"
24 #include "portnum_def.h"
25 #include "s_daqst.h"
26 #include "s_setup.h"
27 #include "s_set_ml.h"
28 #include "s_set_mo.h"
29 #include "f_stccomm.h"
30 #include "f_ut_status.h"
31 
33 
34 int l_status,l;
35 
36 #define VERSION__DAQST 2
37 #define VERSION__SETUP 1
38 #define VERSION__SET_ML 1
39 #define VERSION__SET_MO 1
40 
41 /*1+ C Procedure *************+****************************************/
42 /* */
43 /*+ Module : f_mbs_status */
44 /* */
45 /*--------------------------------------------------------------------*/
46 /*+ CALLING : l_status=f_mbs_status(s_daqst, socket) */
47 /*--------------------------------------------------------------------*/
48 /* */
49 /*+ PURPOSE : Read s_daqst from socket. */
50 /* */
51 /*+ ARGUMENTS : */
52 /*+ s_daqst : pointer to s_daqst */
53 /*+ socket : Tcp socket from connect */
54 /*1- C Procedure *************+****************************************/
55 INTS4 f_mbs_status(CHARS *c_node, s_daqst *ps_daqst)
56 {
57  struct s_tcpcomm *ps_tcpcomm;
58 
59  ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
61  if (l_status != STC__SUCCESS)
62  {
63  free(ps_tcpcomm);
64  return(-2);
65  }
66  l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
68  free(ps_tcpcomm);
69  return l_status;
70 }
71 
72 
73 /*1+ C Procedure *************+****************************************/
74 /* */
75 /*+ Module : f_mbs_setup */
76 /* */
77 /*--------------------------------------------------------------------*/
78 /*+ CALLING : l_status=f_mbs_setup(s_setup, socket) */
79 /*--------------------------------------------------------------------*/
80 /* */
81 /*+ PURPOSE : Read s_setup from socket. */
82 /* */
83 /*+ ARGUMENTS : */
84 /*+ s_setup : pointer to s_setup */
85 /*+ socket : Tcp socket from connect */
86 /*1- C Procedure *************+****************************************/
87 INTS4 f_mbs_setup(CHARS *c_node, s_setup *ps_setup)
88 {
89  s_daqst *ps_daqst;
90  struct s_tcpcomm *ps_tcpcomm;
91 
92  ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
94  if (l_status != STC__SUCCESS)
95  {
96  free(ps_tcpcomm);
97  return(-2);
98  }
99  ps_daqst = (s_daqst *) malloc (sizeof( s_daqst));
100  l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
103  if (l_status != STC__SUCCESS)
104  {
105  free(ps_tcpcomm);
106  free(ps_daqst);
107  return(-1);
108  }
109  if(ps_daqst->bh_setup_loaded == 0) l_status=-3;
110  else l_status = f_ut_setup_r (ps_setup, l_gl_tcp_chan);
112  free(ps_daqst);
113  free(ps_tcpcomm);
114  return l_status;
115 }
116 
117 
118 /*1+ C Procedure *************+****************************************/
119 /* */
120 /*+ Module : f_mbs_ml_setup */
121 /* */
122 /*--------------------------------------------------------------------*/
123 /*+ CALLING : l_status=f_mbs_ml_setup(s_set_ml, socket) */
124 /*--------------------------------------------------------------------*/
125 /* */
126 /*+ PURPOSE : Read s_set_ml from socket. */
127 /* */
128 /*+ ARGUMENTS : */
129 /*+ s_set_ml : pointer to s_set_ml */
130 /*+ socket : Tcp socket from connect */
131 /*1- C Procedure *************+****************************************/
132 INTS4 f_mbs_ml_setup(CHARS *c_node, s_set_ml *ps_set_ml)
133 {
134  s_daqst *ps_daqst;
135  struct s_tcpcomm *ps_tcpcomm;
136 
137  ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
139  if (l_status != STC__SUCCESS)
140  {
141  free(ps_tcpcomm);
142  return(-2);
143  }
144  ps_daqst = (s_daqst *) malloc (sizeof( s_daqst));
145  l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
148  if (l_status != STC__SUCCESS)
149  {
150  free(ps_tcpcomm);
151  free(ps_daqst);
152  return(-1);
153  }
154  if(ps_daqst->bh_set_ml_loaded == 0) l_status=-3;
155  else l_status = f_ut_set_ml_r (ps_set_ml, l_gl_tcp_chan);
157  free(ps_tcpcomm);
158  free(ps_daqst);
159  return l_status;
160 }
161 /*1+ C Procedure *************+****************************************/
162 /* */
163 /*+ Module : f_mbs_mo_setup */
164 /* */
165 /*--------------------------------------------------------------------*/
166 /*+ CALLING : l_status=f_mbs_mo_setup(s_set_mo, socket) */
167 /*--------------------------------------------------------------------*/
168 /* */
169 /*+ PURPOSE : Read s_set_mo from socket. */
170 /* */
171 /*+ ARGUMENTS : */
172 /*+ s_set_mo : pointer to s_set_mo */
173 /*+ socket : Tcp socket from connect */
174 /*1- C Procedure *************+****************************************/
175 INTS4 f_mbs_mo_setup(CHARS *c_node, s_set_mo *ps_set_mo)
176 {
177  s_daqst *ps_daqst;
178  struct s_tcpcomm *ps_tcpcomm;
179 
180  ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
182  if (l_status != STC__SUCCESS)
183  {
184  free(ps_tcpcomm);
185  return(-2);
186  }
187  ps_daqst = (s_daqst *) malloc (sizeof( s_daqst));
188  l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
191  if (l_status != STC__SUCCESS)
192  {
193  free(ps_tcpcomm);
194  free(ps_daqst);
195  return(-1);
196  }
197  if(ps_daqst->bh_set_mo_loaded == 0) l_status=-3;
198  else l_status = f_ut_set_mo_r (ps_set_mo, l_gl_tcp_chan);
200  free(ps_tcpcomm);
201  free(ps_daqst);
202  return l_status;
203 }
INTS4 f_ut_status_r(s_daqst *ps_daqst, INTS4 l_tcp)
Definition: f_ut_status.c:157
#define PORT__STAT_SERV
Definition: portnum_def.h:27
INTU4 bh_set_ml_loaded
Definition: s_daqst.h:34
INTS4 f_ut_set_mo_r(s_set_mo *ps_set_mo, INTS4 l_tcp)
Definition: f_ut_status.c:859
INTS4 f_mbs_status(CHARS *c_node, s_daqst *ps_daqst)
Definition: f_mbs_status.c:55
int l
Definition: f_mbs_status.c:34
INTS4 f_mbs_mo_setup(CHARS *c_node, s_set_mo *ps_set_mo)
Definition: f_mbs_status.c:175
INTU4 bh_setup_loaded
Definition: s_daqst.h:33
INTS4 f_stc_discclient(INTS4 i_channel)
Definition: f_stccomm.c:1149
INTS4 f_ut_set_ml_r(s_set_ml *ps_set_ml, INTS4 l_tcp)
Definition: f_ut_status.c:740
INTS4 f_stc_connectserver(CHARS *c_node, INTS4 l_port, INTS4 *pi_channel, struct s_tcpcomm *ps_client)
Definition: f_stccomm.c:470
#define STC__SUCCESS
Definition: f_stccomm.h:364
int INTS4
Definition: typedefs.h:28
INTS4 f_mbs_ml_setup(CHARS *c_node, s_set_ml *ps_set_ml)
Definition: f_mbs_status.c:132
INTS4 f_mbs_setup(CHARS *c_node, s_setup *ps_setup)
Definition: f_mbs_status.c:87
INTS4 l_gl_tcp_chan
Definition: f_mbs_status.c:32
INTU4 bh_set_mo_loaded
Definition: s_daqst.h:35
INTS4 f_ut_setup_r(s_setup *ps_setup, INTS4 l_tcp)
Definition: f_ut_status.c:511
int l_status
Definition: f_mbs_status.c:34
char CHARS
Definition: typedefs.h:21