commit 3c5fe8c9026a117fb045d06629a2353800e0304e
parent 11400b6d369abfb5c2ec82180ed987fb967e11dc
Author: Christos Margiolis <christos@margiolis.net>
Date: Fri, 14 Aug 2020 03:21:21 +0300
added ncurses detection and declared header functions extern
Diffstat:
4 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/obj/main.o b/obj/main.o
Binary files differ.
diff --git a/obj/plane.o b/obj/plane.o
Binary files differ.
diff --git a/src/main.c b/src/main.c
@@ -13,6 +13,10 @@ static void keys_handle(Plane *p, int key);
int
main(int argc, char **argv)
{
+#ifndef NCURSES_VERSION
+ fprintf(stderr, "ncurses is needed in order to run this program.\n");
+ return EXIT_FAILURE;
+#endif /* NCURSES_VERSION */
curses_init();
Plane p;
plane_init(&p);
diff --git a/src/plane.h b/src/plane.h
@@ -27,14 +27,14 @@ typedef struct {
extern Plane p;
-void plane_init(Plane *p);
-float plane_scale(float val, float omin, float omax, float nmin, float nmax);
-void plane_shift(Plane *p, float xshift, float yshift);
-void zoom_restore(Plane *p);
-void zoom_handle(Plane *p, float factor);
-void get_step(const Plane *p, float *xstep, float *ystep);
-void axes_draw(const Plane *p);
-void graph_draw(const Plane *p);
-void graph_plot(const Plane *p, float x, float y);
+extern void plane_init(Plane *p);
+extern float plane_scale(float val, float omin, float omax, float nmin, float nmax);
+extern void plane_shift(Plane *p, float xshift, float yshift);
+extern void zoom_restore(Plane *p);
+extern void zoom_handle(Plane *p, float factor);
+extern void get_step(const Plane *p, float *xstep, float *ystep);
+extern void axes_draw(const Plane *p);
+extern void graph_draw(const Plane *p);
+extern void graph_plot(const Plane *p, float x, float y);
#endif /* PLANE_H */