1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef __DADA_PWC_MAIN_MULTI_H
#define __DADA_PWC_MAIN_MULTI_H
/* ************************************************************************
dada_pwc_main_multi_t - a struct and associated routines for creation and
execution of a dada primary write client main loop
************************************************************************ */
#include "dada_pwc.h"
#include "multilog.h"
#include "dada_hdu.h"
#include "ipcio.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct dada_pwc_main_multi {
/*! The primary write client control connection */
dada_pwc_t* pwc;
/*! The status and error logging interface */
multilog_t* log;
/*! The HDU blocks */
dada_hdu_t ** hdus;
/*! Pointer to the function that starts data transfer */
time_t (*start_function) (struct dada_pwc_main_multi*, time_t utc);
/*! Pointer to the function that returns an array of data buffers */
void** (*buffer_function) (struct dada_pwc_main_multi*, uint64_t* size);
/*! Pointer to the function that stops data transfer */
int (*stop_function) (struct dada_pwc_main_multi*);
/*! Pointer to the function that handles data transfer error*/
int (*error_function) (struct dada_pwc_main_multi*);
/*! Pointer to the function that checks header validity */
int (*header_valid_function) (struct dada_pwc_main_multi*);
/*! Additional context information */
void* context;
/*! The current command from the PWC control connection */
dada_pwc_command_t command;
/*! verbosity level */
int verbose;
/*! flag to determine if we have a valid header */
int header_valid;
/*! number of HDU blocks */
unsigned num_hdus;
} dada_pwc_main_multi_t;
/*! Create a new DADA primary write client main loop */
dada_pwc_main_multi_t* dada_pwc_main_multi_create (unsigned num_hdus);
/*! Destroy a DADA primary write client main loop */
void dada_pwc_main_multi_destroy (dada_pwc_main_multi_t* pwcm);
/*! Run the DADA primary write client main loop */
int dada_pwc_main_multi (dada_pwc_main_multi_t* pwcm);
/*! process error value, and set state accordingly */
void dada_pwc_main_multi_process_error(dada_pwc_main_multi_t* pwcm, int rval);
#ifdef __cplusplus
}
#endif
#endif