new file mode 100644
(file)
index 0000000..
6889196
--- /dev/null
+//
+// tic.h
+//
+//
+// (C) 2021 Thibaut VARENE
+// License: GPLv2 - http://www.gnu.org/licenses/gpl-2.0.html
+//
+
+#ifndef tic_h
+#define tic_h
+
+#include <stdio.h>
+#include <inttypes.h>
+#include <stdbool.h>
+
+#ifdef BAREBUILD
+ #define pr_err(format, ...) /* nothing */
+#else
+ #define pr_err(format, ...) fprintf(stderr, "ERREUR: " format, ## __VA_ARGS__)
+#endif
+
+#define TIC2JSON_VER "1.1"
+
+// The code assumes this fits on 4 bits
+enum tic_unit {
+ U_SANS = 0x00,
+ U_WH,
+ U_VARH,
+ U_A,
+ U_V,
+ U_KVA,
+ U_VA,
+ U_W,
+ U_MIN,
+};
+
+// this is to be packed in the upper 4 bits of a byte: must increment by 0x10
+// by default everything is an int
+enum data_type {
+ T_STRING = 0x10,
+ T_HEX = 0x20,
+};
+
+struct tic_etiquette {
+ uint8_t tok;
+ uint8_t unittype;
+ const char *label;
+ const char *desc;
+};
+
+struct tic_field {
+ struct tic_etiquette etiq;
+ union {
+ char *s;
+ int i;
+ } data;
+ char *horodate;
+};
+
+void make_field(struct tic_field *field, const struct tic_etiquette *etiq, char *horodate, char *data);
+void print_field(struct tic_field *field);
+void free_field(struct tic_field *field);
+void frame_sep(void);
+void frame_err(void);
+
+#endif /* tic_h */
index 7fef597910e0943b0aac625ed95c40237bbfed5f..896ded48dae48b9dc20d10157325da18def14f83 100644 (file)
#include <unistd.h>
#include <err.h>
-#include "tic2json.h"
+#include "tic.h"
#ifdef TICV01
#include "ticv01.tab.h"
int ticv01yylex_destroy();
deleted file mode 100644
(file)
index
e986cc6..0000000
+++ /dev/null
-//
-// tic2json.h
-//
-//
-// (C) 2021 Thibaut VARENE
-// License: GPLv2 - http://www.gnu.org/licenses/gpl-2.0.html
-//
-
-#ifndef tic2json_h
-#define tic2json_h
-
-#include <stdio.h>
-#include <inttypes.h>
-#include <stdbool.h>
-
-#ifdef BAREBUILD
- #define pr_err(format, ...) /* nothing */
-#else
- #define pr_err(format, ...) fprintf(stderr, "ERREUR: " format, ## __VA_ARGS__)
-#endif
-
-#define TIC2JSON_VER "1.1"
-
-// The code assumes this fits on 4 bits
-enum tic_unit {
- U_SANS = 0x00,
- U_WH,
- U_VARH,
- U_A,
- U_V,
- U_KVA,
- U_VA,
- U_W,
- U_MIN,
-};
-
-// this is to be packed in the upper 4 bits of a byte: must increment by 0x10
-// by default everything is an int
-enum data_type {
- T_STRING = 0x10,
- T_HEX = 0x20,
-};
-
-struct tic_etiquette {
- uint8_t tok;
- uint8_t unittype;
- const char *label;
- const char *desc;
-};
-
-struct tic_field {
- struct tic_etiquette etiq;
- union {
- char *s;
- int i;
- } data;
- char *horodate;
-};
-
-void make_field(struct tic_field *field, const struct tic_etiquette *etiq, char *horodate, char *data);
-void print_field(struct tic_field *field);
-void free_field(struct tic_field *field);
-void frame_sep(void);
-void frame_err(void);
-
-#endif /* tic2json_h */
index 2fac10a24bbc8d115661ba43c078549d90eace25..e9269bd1398c0b3cab7b23e2d225cdf44399a351 100644 (file)
SEP \x20
%{
- #include "tic2json.h"
+ #include "tic.h"
#include "ticv01.tab.h"
extern bool filter_mode;
index d5cac26f61aab82e5b4ea6244725b922ba63b8c0..cfe37403e2c006571983860ee8fbaa18f5044468 100644 (file)
%{
#include <stdlib.h>
-#include "tic2json.h"
+#include "tic.h"
int ticv01yylex();
int ticv01yylex_destroy();
index 69179300bfbd562203ebb64f4d142890381ed30b..05293c711163a35f041a4caa0dcac32083e4d425 100644 (file)
SEP \x09
%{
- #include "tic2json.h"
+ #include "tic.h"
#include "ticv02.tab.h"
extern bool filter_mode;
index ab16afaa7e496c03a284d2c23d97dd65c7e472b2..5fa22cace51ec80a47f3fd2f9661ad52e3d0cd44 100644 (file)
%{
#include <stdlib.h>
-#include "tic2json.h"
+#include "tic.h"
int ticv02yylex();
int ticv02yylex_destroy();