X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=include%2Flfta%2Fschema_prototypes.h;fp=include%2Flfta%2Fschema_prototypes.h;h=772525d5b6525973ae5bb30b923b1c31a34b788c;hb=87cd81502f23b63c980bbce93b6159379299c782;hp=1b6961024bfa527aeeee1f908c151bfcbf510cf0;hpb=989d19428b3d21982b048cf256f625a8ca664c2e;p=com%2Fgs-lite.git diff --git a/include/lfta/schema_prototypes.h b/include/lfta/schema_prototypes.h index 1b69610..772525d 100644 --- a/include/lfta/schema_prototypes.h +++ b/include/lfta/schema_prototypes.h @@ -1,6 +1,11 @@ #ifndef __SCHEMA_PROTOTYPES__ #define __SCHEMA_PROTOTYPES__ +#ifdef __cplusplus +extern "C" { +#endif + + /* ------------------------------------------------ Copyright 2014 AT&T Intellectual Property Licensed under the Apache License, Version 2.0 (the "License"); @@ -142,6 +147,17 @@ static inline __attribute__((always_inline)) long gs_strtoll (const char *str, s /* CSV access function using position as 3rd argument */ +static inline gs_retval_t get_csv_float_to_timestamp(struct packet * p, gs_uint32_t * t,gs_uint32_t pos) +{ +#ifdef PARSER_SANITY_CHECKS + if (p->ptype != PTYPE_CSV) return -1; + if (p->record.csv.numberfields < pos) return -1; +#endif +// *t = strtoul((const char*)p->record.csv.fields[pos-1], NULL, 10); + *t = gs_strtoul((const char*)p->record.csv.fields[pos-1], p->record.csv.field_lens[pos-1]<10 ? p->record.csv.field_lens[pos-1] : 10); + return 0; +} + static inline gs_retval_t get_csv_uint(struct packet * p, gs_uint32_t * t,gs_uint32_t pos) { #ifdef PARSER_SANITY_CHECKS @@ -515,6 +531,9 @@ static inline gs_retval_t get_gdat_float(struct packet * p, gs_float_t * t,gs_ui // External functions +#ifdef __cplusplus +} +#endif #endif