nds2-client - Developer 0.16.7
Loading...
Searching...
No Matches
daqc_internal.h
Go to the documentation of this file.
1/* -*- tab-width:8 c-basic-offset:4 indent-tabs-mode:nil -*- */
2/* set vi: ts=8:softtabstop=4,shiftwidth=4,expandtab */
3
4#ifndef DAQC_INTERNAL_H
5#define DAQC_INTERNAL_H
6
7#if HAVE_CONFIG_H
8#include "daq_config.h"
9#endif /* HAVE_CONFIG_H */
10
11#include "daqc.h"
12#include "daqc_private.h"
13
14#ifndef DLL_EXPORT
15#if WIN32 || WIN64
16#define DLL_EXPORT __declspec( dllexport )
17#else
18#define DLL_EXPORT
19#endif /* WIN32 || WIN64 */
20#endif /* DLL_EXPORT */
21
57
58/* Signal_conv_t1 (internal??)
59 */
60
76
90 int num_groups,
91 int* num_channel_groups_received );
92
93/* Internal NDS1/2 functions
94 */
95
104DLL_EXPORT int daq_set_server( daq_t* daq, const char* host, int port );
105
106/* Internal NDS1 functions
107 */
108
115
124
137DLL_EXPORT size_t swap_data( size_t gran, size_t nBytes, char* data );
138
144DLL_EXPORT enum chantype cvt_group_chantype( int group_num );
145
150DLL_EXPORT long dca_strtol( const char* str );
151
163
171DLL_EXPORT int read_bytes( nds_socket_type fd, char* cptr, size_t numb );
172
180DLL_EXPORT int read_float( nds_socket_type fd, float* data );
181
190
201DLL_EXPORT int
202_daq_read_cstring( nds_socket_type fd, size_t maxlen, char* buf );
203
214DLL_EXPORT int _daq_read_string( nds_socket_type fd, size_t maxlen, char* buf );
215
225DLL_EXPORT int null_term( char* p, int len );
226
239DLL_EXPORT size_t _daq_get_string( const char** p,
240 const char* end,
241 char* out,
242 size_t lmax );
243
250DLL_EXPORT int _daq_cvt_string( unsigned long in, char* out );
251
258DLL_EXPORT int _daq_cvt_ll_string( unsigned long long in, char* out );
259
267
271#if _WIN32
272DLL_EXPORT void nds_perror( const char* Message );
273#endif /* _WIN32 */
274
275#if SIZEOF_TIME_T == SIZEOF_LONG
276#define daq_cvt_timet_string( In, Out ) \
277 _daq_cvt_string( (unsigned long)In, Out )
278#elif SIZEOF_TIME_T == SIZEOF_LONG_LONG
279#define daq_cvt_timet_string( In, Out ) \
280 _daq_cvt_ll_string( (unsigned long long)In, Out )
281#endif
282
283#endif /* !defined(DAQC_INTERNAL_H) */
#define DLL_EXPORT
Definition channel.h:12
unsigned int uint4_type
Definition daqc.h:17
int nds_socket_type
Definition daqc_private.h:12
chantype
Channel type code enumerator.
Definition channel.h:28
DLL_EXPORT int _daq_read_cstring(nds_socket_type fd, size_t maxlen, char *buf)
read an nds string.
Definition daqc_internal.c:390
DLL_EXPORT int _daq_cycle_conn(daq_t *daq)
Definition daqc_access.c:304
DLL_EXPORT int _daq_cvt_ll_string(unsigned long long in, char *out)
Convert an integer to a string.
Definition daqc_internal.c:479
DLL_EXPORT int _daq_read_string(nds_socket_type fd, size_t maxlen, char *buf)
read an nds2 string.
Definition daqc_internal.c:342
DLL_EXPORT long read_server_response_wait(nds_socket_type fd, int wt)
Get a response integer (internal function).
Definition daqc_internal.c:256
DLL_EXPORT int daq_recv_channel_groups(daq_t *daq, daq_channel_group_t *group, int num_groups, int *num_channel_groups_received)
Receive a list of channel groups.
Definition daqc_internal.c:616
DLL_EXPORT int _daq_cvt_string(unsigned long in, char *out)
Convert an integer to a string.
Definition daqc_internal.c:463
DLL_EXPORT int read_float(nds_socket_type fd, float *data)
Read a float data word.
Definition daqc_internal.c:311
DLL_EXPORT int daq_set_server(daq_t *daq, const char *host, int port)
Set the server address.
Definition daqc_internal.c:545
DLL_EXPORT long dca_strtol(const char *str)
Definition daqc_internal.c:129
DLL_EXPORT int _daq_wait_data(nds_socket_type fd, int wt)
Wait for data to arrive.
Definition daqc_internal.c:145
DLL_EXPORT size_t _daq_get_string(const char **p, const char *end, char *out, size_t lmax)
Copy a blank or null terminated string to an output buffer.
Definition daqc_internal.c:440
DLL_EXPORT enum chantype cvt_group_chantype(int group_num)
Convert group code to channel type.
Definition daqc_internal.c:110
DLL_EXPORT int read_bytes(nds_socket_type fd, char *cptr, size_t numb)
Read a ‘numb’ bytes.
Definition daqc_internal.c:213
DLL_EXPORT int read_uint4(nds_socket_type fd, uint4_type *data)
Read a 4-byte integer data word.
Definition daqc_internal.c:328
DLL_EXPORT long read_server_response(nds_socket_type fd)
Get a response code (internal function).
Definition daqc_internal.c:282
DLL_EXPORT size_t swap_data(size_t gran, size_t nBytes, char *data)
Swap data bytes.
Definition daqc_internal.c:57
struct signal_conv1 signal_conv_t1
DLL_EXPORT int null_term(char *p, int len)
Add a NULL after the last non-blank in a string.
Definition daqc_internal.c:420
NDS1/2 client status structure.
Definition daqc.h:233
Received data header.
Definition daqc_internal.h:35
uint4_type secs
Definition daqc_internal.h:38
uint4_type gpsn
Definition daqc_internal.h:47
uint4_type gps
Definition daqc_internal.h:43
char data[1]
Definition daqc_internal.h:55
uint4_type seq_num
Definition daqc_internal.h:51
Channel group structure.
Definition daqc.h:353
Definition daqc_internal.h:65
float signal_offset
Definition daqc_internal.h:71
float signal_slope
Definition daqc_internal.h:68
uint4_type signal_status
Definition daqc_internal.h:74