Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3bc1af1 authored by Ruchir Rastogi's avatar Ruchir Rastogi
Browse files

Move type ids to stats_event.h

This allows the parsing code within statsd to access the type ids.
Also, we move stats_event.h to the include directory for consistency.

Test: m -j libstatssocket
Change-Id: I7030416872677f3a523c2baf7bf6bcb4ca0ae6a4
Merged-In: I1db7fc9e9d0efd2225612353a8fc49bb13220ff0
parent f4d23fc3
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -59,6 +59,19 @@ struct stats_event;
#define ERROR_TOO_MANY_ANNOTATIONS 0x80
#define ERROR_TOO_MANY_FIELDS 0x100

/* TYPE IDS */
#define INT32_TYPE 0x00
#define INT64_TYPE 0x01
#define STRING_TYPE 0x02
#define LIST_TYPE 0x03
#define FLOAT_TYPE 0x04
#define BOOL_TYPE 0x05
#define BYTE_ARRAY_TYPE 0x06
#define OBJECT_TYPE 0x07
#define KEY_VALUE_PAIRS_TYPE 0x08
#define ATTRIBUTION_CHAIN_TYPE 0x09
#define ERROR_TYPE 0x0F

/* SYSTEM API */
struct stats_event* stats_event_obtain();
void stats_event_write(struct stats_event* event);
+1 −14
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
 * limitations under the License.
 */

#include "stats_event.h"
#include "include/stats_event.h"
#include <stdlib.h>
#include <string.h>
#include <time.h>
@@ -34,19 +34,6 @@
#define POS_ATOM_ID (POS_TIMESTAMP + sizeof(byte) + sizeof(uint64_t))
#define POS_FIRST_FIELD (POS_ATOM_ID + sizeof(byte) + sizeof(uint32_t))

/* TYPE IDS */
#define INT32_TYPE 0x00
#define INT64_TYPE 0x01
#define STRING_TYPE 0x02
#define LIST_TYPE 0x03
#define FLOAT_TYPE 0x04
#define BOOL_TYPE 0x05
#define BYTE_ARRAY_TYPE 0x06
#define OBJECT_TYPE 0x07
#define KEY_VALUE_PAIR_TYPE 0x08
#define ATTRIBUTION_CHAIN_TYPE 0x09
#define ERROR_TYPE 0x0F

/* LIMITS */
#define MAX_ANNOTATION_COUNT 15
#define MAX_ANNOTATION_ID 127