My Project
programmer's documentation
cs_control.h
Go to the documentation of this file.
1 #ifndef __CS_CONTROL_H__
2 #define __CS_CONTROL_H__
3 
4 /*============================================================================
5  * Interactive control management.
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2019 EDF S.A.
12 
13  This program is free software; you can redistribute it and/or modify it under
14  the terms of the GNU General Public License as published by the Free Software
15  Foundation; either version 2 of the License, or (at your option) any later
16  version.
17 
18  This program is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21  details.
22 
23  You should have received a copy of the GNU General Public License along with
24  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25  Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27 
28 /*----------------------------------------------------------------------------*/
29 
30 /*----------------------------------------------------------------------------
31  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_defs.h"
35 #include "cs_time_step.h"
36 
37 /*----------------------------------------------------------------------------*/
38 
40 
41 /*=============================================================================
42  * Macro definitions
43  *============================================================================*/
44 
45 typedef enum {
46 
47  CS_CONTROL_COMM_TYPE_SOCKET, /* Communicate through sockets */
48  CS_CONTROL_COMM_TYPE_NULL /* Null communicator */
49 
51 
52 /*============================================================================
53  * Type definitions
54  *============================================================================*/
55 
56 /*============================================================================
57  * Public function prototypes
58  *============================================================================*/
59 
60 /*----------------------------------------------------------------------------*/
64 /*----------------------------------------------------------------------------*/
65 
66 void
68 
69 /*----------------------------------------------------------------------------
70  * Check the presence of a control file and deal with the interactive
71  * control.
72  *----------------------------------------------------------------------------*/
73 
74 void
76 
77 /*----------------------------------------------------------------------------*/
85 /*----------------------------------------------------------------------------*/
86 
87 void
88 cs_control_comm_initialize(const char *port_name,
89  const char *key,
91 
92 /*----------------------------------------------------------------------------*/
96 /*----------------------------------------------------------------------------*/
97 
98 void
100 
101 /*----------------------------------------------------------------------------*/
109 /*----------------------------------------------------------------------------*/
110 
111 void
112 cs_control_comm_write(const void *rec,
113  size_t size,
114  size_t count);
115 
116 /*----------------------------------------------------------------------------*/
124 /*----------------------------------------------------------------------------*/
125 
126 void
127 cs_control_comm_read(void *rec,
128  size_t size,
129  size_t count);
130 
131 /*----------------------------------------------------------------------------*/
140 /*----------------------------------------------------------------------------*/
141 
142 size_t
144 
145 /*----------------------------------------------------------------------------*/
146 
148 
149 #endif /* __CS_CONTROL_H__ */
cs_control_comm_finalize
void cs_control_comm_finalize(void)
Finalize a connection to a client.
Definition: cs_control.c:1439
cs_defs.h
cs_control_finalize
void cs_control_finalize(void)
Finalize controller structures.
Definition: cs_control.c:1261
cs_control_comm_initialize
void cs_control_comm_initialize(const char *port_name, const char *key, cs_control_comm_type_t type)
Establish a connection to a client.
Definition: cs_control.c:1413
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_control_comm_read_to_queue
size_t cs_control_comm_read_to_queue(void)
Read data from a client into a command queue.
Definition: cs_control.c:1507
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_control_comm_type_t
cs_control_comm_type_t
Definition: cs_control.h:45
cs_control_comm_write
void cs_control_comm_write(const void *rec, size_t size, size_t count)
Write a record to a client.
Definition: cs_control.c:1456
CS_CONTROL_COMM_TYPE_NULL
Definition: cs_control.h:48
cs_time_step.h
cs_control_check_file
void cs_control_check_file(void)
Check the presence of a control file and deal with the interactive control.
Definition: cs_control.c:1275
cs_control_comm_read
void cs_control_comm_read(void *rec, size_t size, size_t count)
Read a record from a client.
Definition: cs_control.c:1481
CS_CONTROL_COMM_TYPE_SOCKET
Definition: cs_control.h:47
type
void const cs_int_t * type
Definition: cs_measures_util.h:425