GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
f_mbs_status.c
Go to the documentation of this file.
1 // $Id$
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 fuer 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 "f_stccomm.h"
26 #include "f_ut_status.h"
27 #include "f_mbs_status.h"
28 
30 
31 int l_status,l;
32 
33 #define VERSION__DAQST 2
34 #define VERSION__SETUP 1
35 #define VERSION__SET_ML 1
36 #define VERSION__SET_MO 1
37 
38 /*1+ C Procedure *************+****************************************/
39 /* */
40 /*+ Module : f_mbs_status */
41 /* */
42 /*--------------------------------------------------------------------*/
43 /*+ CALLING : l_status=f_mbs_status(s_daqst, socket) */
44 /*--------------------------------------------------------------------*/
45 /* */
46 /*+ PURPOSE : Read s_daqst from socket. */
47 /* */
48 /*+ ARGUMENTS : */
49 /*+ s_daqst : pointer to s_daqst */
50 /*+ socket : Tcp socket from connect */
51 /*1- C Procedure *************+****************************************/
52 INTS4 f_mbs_status(CHARS *c_node, s_daqst *ps_daqst)
53 {
54  struct s_tcpcomm *ps_tcpcomm;
55 
56  ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
58  if (l_status != STC__SUCCESS)
59  {
60  free(ps_tcpcomm);
61  return(-2);
62  }
63  l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
65  free(ps_tcpcomm);
66  return l_status;
67 }
68 
69 
70 /*1+ C Procedure *************+****************************************/
71 /* */
72 /*+ Module : f_mbs_setup */
73 /* */
74 /*--------------------------------------------------------------------*/
75 /*+ CALLING : l_status=f_mbs_setup(s_setup, socket) */
76 /*--------------------------------------------------------------------*/
77 /* */
78 /*+ PURPOSE : Read s_setup from socket. */
79 /* */
80 /*+ ARGUMENTS : */
81 /*+ s_setup : pointer to s_setup */
82 /*+ socket : Tcp socket from connect */
83 /*1- C Procedure *************+****************************************/
84 INTS4 f_mbs_setup(CHARS *c_node, s_setup *ps_setup)
85 {
86  s_daqst *ps_daqst;
87  struct s_tcpcomm *ps_tcpcomm;
88 
89  ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
91  if (l_status != STC__SUCCESS)
92  {
93  free(ps_tcpcomm);
94  return(-2);
95  }
96  ps_daqst = (s_daqst *) malloc (sizeof( s_daqst));
97  l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
100  if (l_status != STC__SUCCESS)
101  {
102  free(ps_tcpcomm);
103  free(ps_daqst);
104  return(-1);
105  }
106  if(ps_daqst->bh_setup_loaded == 0) l_status=-3;
107  else l_status = f_ut_setup_r (ps_setup, l_gl_tcp_chan);
109  free(ps_daqst);
110  free(ps_tcpcomm);
111  return l_status;
112 }
113 
114 
115 /*1+ C Procedure *************+****************************************/
116 /* */
117 /*+ Module : f_mbs_ml_setup */
118 /* */
119 /*--------------------------------------------------------------------*/
120 /*+ CALLING : l_status=f_mbs_ml_setup(s_set_ml, socket) */
121 /*--------------------------------------------------------------------*/
122 /* */
123 /*+ PURPOSE : Read s_set_ml from socket. */
124 /* */
125 /*+ ARGUMENTS : */
126 /*+ s_set_ml : pointer to s_set_ml */
127 /*+ socket : Tcp socket from connect */
128 /*1- C Procedure *************+****************************************/
129 INTS4 f_mbs_ml_setup(CHARS *c_node, s_set_ml *ps_set_ml)
130 {
131  s_daqst *ps_daqst;
132  struct s_tcpcomm *ps_tcpcomm;
133 
134  ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
136  if (l_status != STC__SUCCESS)
137  {
138  free(ps_tcpcomm);
139  return(-2);
140  }
141  ps_daqst = (s_daqst *) malloc (sizeof( s_daqst));
142  l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
145  if (l_status != STC__SUCCESS)
146  {
147  free(ps_tcpcomm);
148  free(ps_daqst);
149  return(-1);
150  }
151  if(ps_daqst->bh_set_ml_loaded == 0) l_status=-3;
152  else l_status = f_ut_set_ml_r (ps_set_ml, l_gl_tcp_chan);
154  free(ps_tcpcomm);
155  free(ps_daqst);
156  return l_status;
157 }
158 /*1+ C Procedure *************+****************************************/
159 /* */
160 /*+ Module : f_mbs_mo_setup */
161 /* */
162 /*--------------------------------------------------------------------*/
163 /*+ CALLING : l_status=f_mbs_mo_setup(s_set_mo, socket) */
164 /*--------------------------------------------------------------------*/
165 /* */
166 /*+ PURPOSE : Read s_set_mo from socket. */
167 /* */
168 /*+ ARGUMENTS : */
169 /*+ s_set_mo : pointer to s_set_mo */
170 /*+ socket : Tcp socket from connect */
171 /*1- C Procedure *************+****************************************/
172 INTS4 f_mbs_mo_setup(CHARS *c_node, s_set_mo *ps_set_mo)
173 {
174  s_daqst *ps_daqst;
175  struct s_tcpcomm *ps_tcpcomm;
176 
177  ps_tcpcomm = (struct s_tcpcomm *) malloc (sizeof( struct s_tcpcomm));
179  if (l_status != STC__SUCCESS)
180  {
181  free(ps_tcpcomm);
182  return(-2);
183  }
184  ps_daqst = (s_daqst *) malloc (sizeof( s_daqst));
185  l_status = f_ut_status_r (ps_daqst, l_gl_tcp_chan);
188  if (l_status != STC__SUCCESS)
189  {
190  free(ps_tcpcomm);
191  free(ps_daqst);
192  return(-1);
193  }
194  if(ps_daqst->bh_set_mo_loaded == 0) l_status=-3;
195  else l_status = f_ut_set_mo_r (ps_set_mo, l_gl_tcp_chan);
197  free(ps_tcpcomm);
198  free(ps_daqst);
199  return l_status;
200 }
INTS4 f_ut_status_r(s_daqst *ps_daqst, INTS4 l_tcp)
Definition: f_ut_status.c:150
#define PORT__STAT_SERV
Definition: portnum_def.h:29
INTU4 bh_set_ml_loaded
Definition: s_daqst.h:54
INTS4 f_ut_set_mo_r(s_set_mo *ps_set_mo, INTS4 l_tcp)
Definition: f_ut_status.c:860
INTS4 f_mbs_status(CHARS *c_node, s_daqst *ps_daqst)
Definition: f_mbs_status.c:52
int l
Definition: f_mbs_status.c:31
INTS4 f_mbs_mo_setup(CHARS *c_node, s_set_mo *ps_set_mo)
Definition: f_mbs_status.c:172
INTU4 bh_setup_loaded
Definition: s_daqst.h:53
INTS4 f_stc_discclient(INTS4 i_channel)
Definition: f_stccomm.c:1170
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:494
#define STC__SUCCESS
Definition: f_stccomm.h:369
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:129
INTS4 f_mbs_setup(CHARS *c_node, s_setup *ps_setup)
Definition: f_mbs_status.c:84
INTS4 l_gl_tcp_chan
Definition: f_mbs_status.c:29
INTU4 bh_set_mo_loaded
Definition: s_daqst.h:55
INTS4 f_ut_setup_r(s_setup *ps_setup, INTS4 l_tcp)
Definition: f_ut_status.c:503
int l_status
Definition: f_mbs_status.c:31
char CHARS
Definition: typedefs.h:21