diff --git a/source/main_generator.c b/source/main_generator.c index 643e6e2..21c8b27 100644 --- a/source/main_generator.c +++ b/source/main_generator.c @@ -3,19 +3,6 @@ #include <string.h> #include <ctype.h> -#define INITIALIZE_ARRAY(a, n, x) do {\ - for (int i = 0; i < n; i++) { \ - a[i] = x; \ - } \ - } while (0) -#define INITIALIZE_MATRIX(a, n, m, x) do {\ - for (int i = 0; i < n; i++) { \ - for (int h = 0; h < m; h++) { \ - a[i][h] = x; \ - } \ - } \ - } while (0) - //#define AS_SYMBOL(c) (c-'a') #define AS_SYMBOL(c) c #define ALPHABET_SIZE 128 diff --git a/source/util.h b/source/util.h new file mode 100644 index 0000000..78bd671 --- /dev/null +++ b/source/util.h @@ -0,0 +1,18 @@ +#ifndef UTIL_H +#define UTIL_H + +#define INITIALIZE_ARRAY(a, n, x) do {\ + for (int i = 0; i < n; i++) { \ + a[i] = x; \ + } \ + } while (0) + +#define INITIALIZE_MATRIX(a, n, m, x) do {\ + for (int i = 0; i < n; i++) { \ + for (int h = 0; h < m; h++) { \ + a[i][h] = x; \ + } \ + } \ + } while (0) + +#endif