From a470c304199866aa1f3d39ff22ec30734f03d617 Mon Sep 17 00:00:00 2001 From: justanothercatgirl Date: Fri, 6 Dec 2024 15:08:31 +0300 Subject: сделал 8 задание)))) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 7_2/main.c | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 7_2/main.c (limited to '7_2/main.c') diff --git a/7_2/main.c b/7_2/main.c deleted file mode 100644 index edb4b76..0000000 --- a/7_2/main.c +++ /dev/null @@ -1,44 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -#include "input.h" -#include "drawable.h" -#include "figure.h" - -long fatness = 1; // пока никак не используется - -int sx = 100, sy = 100; - -int main(int argc, char *argv[]) { - char file[256] = {}; - if (argc >= 2) { - size_t len = strlen(argv[1]); - memcpy(file, argv[1], len > 255 ? 255 : len); - } else { - printf("введите файл: "); - scanf("%255s", file); - } - char x11 = 0; - for (int i = 0; i < argc; ++i) { - if (!strcmp("-X", argv[i])) x11 = 1; - } - struct figure *fs = read_file(file); - struct drawable d = x11 ? drawable_X11(sx, sy) : drawable_plaintxt(sx, sy); - if (!fs) { - fprintf(stderr, "ERROR: errno %i: %s\n", errno, strerror(errno)); - return 1; - } - for (struct figure *i = fs; i->type != F_NONE; ++i) - i->draw(i, &d); - - d.show(&d); - free(fs); - drawable_destroy(&d); - return 0; -} - -- cgit v1.2.3-70-g09d2