File: qap.h

package info (click to toggle)
r-cran-rsclient 0.7-10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 236 kB
  • sloc: ansic: 2,137; makefile: 2
file content (51 lines) | stat: -rw-r--r-- 1,104 bytes parent folder | download | duplicates (2)
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
#ifndef QAP_H__
#define QAP_H__


#include <Rinternals.h>

#define RSERVE_PKG 1

#include "RSprotocol.h"

/* NOTE: we only support little-endian machines! */
#define NATIVE_COPY 1

/* stuff to enulate compatibility with Rserve's use */
#define DISABLE_ENCODING 1
#ifndef ptoi
#define ptoi(X) X
#endif
#ifndef itop
#define itop(X) ptoi(X)
#endif
#define fixdcpy(A, B) memcpy(A, B, 8)

/* does this R have R_xlen_t ? */
#ifdef R_XLEN_T_MAX
typedef R_xlen_t rlen_t;
/* we cannot use R_XLEN_T_MAX since that is 2^52 for 64-bit */
#ifdef LONG_VECTOR_SUPPORT
#define rlen_max ((rlen_t) 0xffffffffffffffff)
#else
#define rlen_max ((rlen_t) 0xffffffff)
#endif
#else
/* legacy compatibility to use unsigned long */
typedef unsigned long rlen_t;
#ifdef ULONG_MAX
#define rlen_max ULONG_MAX
#else
#ifdef __LP64__
#define rlen_max 0xffffffffffffffffL 
#else
#define rlen_max 0xffffffffL
#endif /* __LP64__ */
#endif /* ULONG_MAX */
#endif /* R_XLEN_T_MAX */

SEXP QAP_decode(unsigned int **buf);
rlen_t QAP_getStorageSize(SEXP x);
unsigned int* QAP_storeSEXP(unsigned int* buf, SEXP x, rlen_t storage_size);

#endif