reactor-c
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
influxdb.h File Reference
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/uio.h>
#include <netdb.h>
#include <stdarg.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <curl/curl.h>

Go to the source code of this file.

Data Structures

struct  _influx_client_t
 
struct  _influx_v2_client_t
 

Macros

#define INFLUX_MEAS(m)
 
#define INFLUX_TAG(k, v)
 
#define INFLUX_F_STR(k, v)
 
#define INFLUX_F_FLT(k, v, p)
 
#define INFLUX_F_INT(k, v)
 
#define INFLUX_F_BOL(k, v)
 
#define INFLUX_TS(ts)
 
#define INFLUX_END   IF_TYPE_ARG_END
 
#define IF_TYPE_ARG_END   0
 
#define IF_TYPE_MEAS   1
 
#define IF_TYPE_TAG   2
 
#define IF_TYPE_FIELD_STRING   3
 
#define IF_TYPE_FIELD_FLOAT   4
 
#define IF_TYPE_FIELD_INTEGER   5
 
#define IF_TYPE_FIELD_BOOLEAN   6
 
#define IF_TYPE_TIMESTAMP   7
 
#define _GET_NEXT_CHAR()
 
#define _LOOP_NEXT(statement)
 
#define _UNTIL(c)
 
#define _GET_NUMBER(n)
 
#define _(c)
 
#define _APPEND(fmter...)
 

Typedefs

typedef struct _influx_client_t influx_client_t
 
typedef struct _influx_v2_client_t influx_v2_client_t
 

Functions

int format_line (char **buf, int *len, size_t used,...)
 
int post_http (influx_client_t *c,...)
 
int send_udp (influx_client_t *c,...)
 
int post_curl (influx_v2_client_t *c,...)
 
int _escaped_append (char **dest, size_t *len, size_t *used, const char *src, const char *escape_seq)
 
int _begin_line (char **buf)
 
int _format_line (char **buf, va_list ap)
 
int _format_line2 (char **buf, va_list ap, size_t *, size_t)
 
int post_http_send_line (influx_client_t *c, char *buf, int len)
 
int send_udp_line (influx_client_t *c, char *line, int len)
 

Macro Definition Documentation

◆ _

#define _ ( c)
Value:
if ((_GET_NEXT_CHAR()) != c) \
break;
#define _GET_NEXT_CHAR()

◆ _APPEND

#define _APPEND ( fmter...)
Value:
for (;;) { \
if ((written = snprintf(*buf + used, len - used, ##fmter)) < 0) \
goto FAIL; \
if (used + written >= len && !(*buf = (char*)realloc(*buf, len *= 2))) \
return -1; \
else { \
used += written; \
break; \
} \
}

◆ _GET_NEXT_CHAR

#define _GET_NEXT_CHAR ( )
Value:
(ch = (len >= (int)iv[0].iov_len && \
(iv[0].iov_len = recv(sock, iv[0].iov_base, iv[0].iov_len, len = 0)) == (size_t)(-1) \
? 0 \
: *((char*)iv[0].iov_base + len++)))

◆ _GET_NUMBER

#define _GET_NUMBER ( n)
Value:
_LOOP_NEXT(if (ch >= '0' && ch <= '9') n = n * 10 + (ch - '0'); else break;)
#define _LOOP_NEXT(statement)

◆ _LOOP_NEXT

#define _LOOP_NEXT ( statement)
Value:
for (;;) { \
if (!(_GET_NEXT_CHAR())) { \
ret_code = -8; \
goto END; \
} \
statement \
}

◆ _UNTIL

#define _UNTIL ( c)
Value:
_LOOP_NEXT(if (ch == c) break;)

◆ IF_TYPE_ARG_END

#define IF_TYPE_ARG_END   0

◆ IF_TYPE_FIELD_BOOLEAN

#define IF_TYPE_FIELD_BOOLEAN   6

◆ IF_TYPE_FIELD_FLOAT

#define IF_TYPE_FIELD_FLOAT   4

◆ IF_TYPE_FIELD_INTEGER

#define IF_TYPE_FIELD_INTEGER   5

◆ IF_TYPE_FIELD_STRING

#define IF_TYPE_FIELD_STRING   3

◆ IF_TYPE_MEAS

#define IF_TYPE_MEAS   1

◆ IF_TYPE_TAG

#define IF_TYPE_TAG   2

◆ IF_TYPE_TIMESTAMP

#define IF_TYPE_TIMESTAMP   7

◆ INFLUX_END

#define INFLUX_END   IF_TYPE_ARG_END

◆ INFLUX_F_BOL

#define INFLUX_F_BOL ( k,
v )
Value:
IF_TYPE_FIELD_BOOLEAN, (k), ((v) ? 1 : 0)
#define IF_TYPE_FIELD_BOOLEAN
Definition influxdb.h:71

◆ INFLUX_F_FLT

#define INFLUX_F_FLT ( k,
v,
p )
Value:
IF_TYPE_FIELD_FLOAT, (k), (double)(v), (int)(p)
#define IF_TYPE_FIELD_FLOAT
Definition influxdb.h:69

◆ INFLUX_F_INT

#define INFLUX_F_INT ( k,
v )
Value:
IF_TYPE_FIELD_INTEGER, (k), (long long)(v)
#define IF_TYPE_FIELD_INTEGER
Definition influxdb.h:70

◆ INFLUX_F_STR

#define INFLUX_F_STR ( k,
v )
Value:
#define IF_TYPE_FIELD_STRING
Definition influxdb.h:68

◆ INFLUX_MEAS

#define INFLUX_MEAS ( m)
Value:
#define IF_TYPE_MEAS
Definition influxdb.h:66

◆ INFLUX_TAG

#define INFLUX_TAG ( k,
v )
Value:
IF_TYPE_TAG, (k), (v)
#define IF_TYPE_TAG
Definition influxdb.h:67

◆ INFLUX_TS

#define INFLUX_TS ( ts)
Value:
IF_TYPE_TIMESTAMP, (long long)(ts)
#define IF_TYPE_TIMESTAMP
Definition influxdb.h:72

Typedef Documentation

◆ influx_client_t

◆ influx_v2_client_t

Function Documentation

◆ _begin_line()

int _begin_line ( char ** buf)

◆ _escaped_append()

int _escaped_append ( char ** dest,
size_t * len,
size_t * used,
const char * src,
const char * escape_seq )

◆ _format_line()

int _format_line ( char ** buf,
va_list ap )

◆ _format_line2()

int _format_line2 ( char ** buf,
va_list ap,
size_t * _len,
size_t used )

◆ format_line()

int format_line ( char ** buf,
int * len,
size_t used,
... )

◆ post_curl()

int post_curl ( influx_v2_client_t * c,
... )

◆ post_http()

int post_http ( influx_client_t * c,
... )

◆ post_http_send_line()

int post_http_send_line ( influx_client_t * c,
char * buf,
int len )

◆ send_udp()

int send_udp ( influx_client_t * c,
... )

◆ send_udp_line()

int send_udp_line ( influx_client_t * c,
char * line,
int len )