diff pads2gpcb/silkselect.c @ 62:9d7e2937883d

pads2gpcb: select specific drawing levels for silk with -s
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Sun, 31 Jan 2016 05:30:33 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pads2gpcb/silkselect.c	Sun Jan 31 05:30:33 2016 +0000
@@ -0,0 +1,27 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+#define	MAX_LEVEL_SELECT	8
+
+static int select_array[MAX_LEVEL_SELECT];
+static int num_select;
+
+select_drawlevel_for_silk(level)
+{
+	if (num_select >= MAX_LEVEL_SELECT) {
+		fprintf(stderr, "Error: MAX_LEVEL_SELECT exceeded\n");
+		exit(1);
+	}
+	select_array[num_select++] = level;
+	return(0);
+}
+
+is_drawlevel_selected(level)
+{
+	int i;
+
+	for (i = 0; i < num_select; i++)
+		if (select_array[i] == level)
+			return(1);
+	return(0);
+}