aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorShav Kinderlehrer <[email protected]>2023-04-17 10:23:52 -0400
committerShav Kinderlehrer <[email protected]>2023-04-17 10:23:52 -0400
commita550c7f22985048a0089a529ca89061ab80daff2 (patch)
treeaddafd909c8ba041cf293fd144e5c9891c8952c9 /include
parent6eadc6dd06dfd2fb1f61c4fd142811f10e4a4f51 (diff)
downloadlat-a550c7f22985048a0089a529ca89061ab80daff2.tar.gz
lat-a550c7f22985048a0089a529ca89061ab80daff2.zip
Add optional processing stagev0.7.0
Diffstat (limited to 'include')
-rw-r--r--include/arg.h1
-rw-r--r--include/file.h7
-rw-r--r--include/process.h9
-rw-r--r--include/types.h22
4 files changed, 32 insertions, 7 deletions
diff --git a/include/arg.h b/include/arg.h
index 985daa4..1bf23f4 100644
--- a/include/arg.h
+++ b/include/arg.h
@@ -5,6 +5,7 @@
#define LAT_VERSION "0.4.0"
struct config {
+ bool process;
bool color;
bool lines;
bool has_read_stdin;
diff --git a/include/file.h b/include/file.h
index d440c87..5518d17 100644
--- a/include/file.h
+++ b/include/file.h
@@ -2,13 +2,6 @@
#define FILE_H
#include <stdio.h>
-struct filedata {
- int lc;
- size_t len;
- int binary;
- char *buf;
- char *altbuf;
-};
struct filedata readfile(FILE *fp);
#endif
diff --git a/include/process.h b/include/process.h
new file mode 100644
index 0000000..29e066f
--- /dev/null
+++ b/include/process.h
@@ -0,0 +1,9 @@
+#ifndef PROCESS_H
+#define PROCESS_H
+#include "types.h"
+
+void loadlines(struct filedata *f);
+
+char *linepad(int lc, int total);
+
+#endif
diff --git a/include/types.h b/include/types.h
new file mode 100644
index 0000000..9fb7809
--- /dev/null
+++ b/include/types.h
@@ -0,0 +1,22 @@
+#ifndef TYPES_H
+#define TYPES_H
+
+#include <stdbool.h>
+#include <stddef.h>
+
+struct line {
+ size_t len;
+ char *buf;
+};
+
+struct filedata {
+ int lc;
+ bool binary;
+
+ size_t buflen;
+
+ char *buf;
+ struct line *lines;
+};
+
+#endif