My Project
programmer's documentation
Functions
cs_control.c File Reference
#include "cs_defs.h"
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "bft_mem.h"
#include "bft_printf.h"
#include "cs_file.h"
#include "cs_log.h"
#include "cs_parall.h"
#include "cs_post.h"
#include "cs_resource.h"
#include "cs_restart.h"
#include "cs_time_plot.h"
#include "cs_timer.h"
#include "cs_control.h"
Include dependency graph for cs_control.c:

Functions

void cs_control_finalize (void)
 Finalize controller structures. More...
 
void cs_control_check_file (void)
 Check the presence of a control file and deal with the interactive control. More...
 
void cs_control_comm_initialize (const char *port_name, const char *key, cs_control_comm_type_t type)
 Establish a connection to a client. More...
 
void cs_control_comm_finalize (void)
 Finalize a connection to a client. More...
 
void cs_control_comm_write (const void *rec, size_t size, size_t count)
 Write a record to a client. More...
 
void cs_control_comm_read (void *rec, size_t size, size_t count)
 Read a record from a client. More...
 
size_t cs_control_comm_read_to_queue (void)
 Read data from a client into a command queue. More...
 

Function Documentation

◆ cs_control_check_file()

void cs_control_check_file ( void  )

Check the presence of a control file and deal with the interactive control.

◆ cs_control_comm_finalize()

void cs_control_comm_finalize ( void  )

Finalize a connection to a client.

◆ 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.

Parameters
[in]port_namename of server port (host:port for IP sockets)
[in]keykey for authentification
[in]typecommunication type

◆ cs_control_comm_read()

void cs_control_comm_read ( void *  rec,
size_t  size,
size_t  count 
)

Read a record from a client.

Parameters
[out]recpointer to data to read
[in]sizesize of each data element, in bytes
[in]countnumber of data elements

◆ cs_control_comm_read_to_queue()

size_t cs_control_comm_read_to_queue ( void  )

Read data from a client into a command queue.

The function updates a pointer (view) to the data.

Returns
number of useable elements read (i.e. elements before the last separator)

◆ cs_control_comm_write()

void cs_control_comm_write ( const void *  rec,
size_t  size,
size_t  count 
)

Write a record to a client.

Parameters
[in]recpointer to data to write
[in]sizesize of each data element, in bytes
[in]countnumber of data elements

◆ cs_control_finalize()

void cs_control_finalize ( void  )

Finalize controller structures.