diff options
| author | Anser <rostgans@tutamail.com> | 2026-08-11 00:18:57 +0200 |
|---|---|---|
| committer | Anser <rostgans@tutamail.com> | 2026-08-11 00:18:57 +0200 |
| commit | eb6f986361713d6ce47c6d4572bb24d9f6207ddf (patch) | |
| tree | 3fca62d5cad785acce36a46a660219840c959932 /src/logo | |
| parent | 9ad584b5762433f7c99d7cc7b65ad21ebe4ff932 (diff) | |
TOBESQUISHED: safe in reconstruction of the codes layout and rework of information handeling also ascii art printing
Diffstat (limited to 'src/logo')
| -rw-r--r-- | src/logo/logo.c | 84 | ||||
| -rw-r--r-- | src/logo/logo.h | 6 |
2 files changed, 0 insertions, 90 deletions
diff --git a/src/logo/logo.c b/src/logo/logo.c deleted file mode 100644 index 98cda8d..0000000 --- a/src/logo/logo.c +++ /dev/null @@ -1,84 +0,0 @@ -#include "logo.h" -#include <stddef.h> -#include <stdio.h> -#include <string.h> - -#define MAX_LOGOS 2 - -typedef struct distro_mapping_t { - const char *distro_pattern; - const char *ascii_file; -} distro_mapping_t; - -static const distro_mapping_t distro_mappings[] = { - {"cccp", "cccp.ascii"}, - {"cccp_shield", "cccp_shield.ascii"}, - {NULL, NULL} -}; - -const char **logo(int index) { - - static const char *logo0[] = { -" _____________", -" / \\", -" | ☆ ☆ ☆ |", -" | ☆ ☭ ☆ |", -" | ☆ ☆ ☆ |", -" \\_____________/", -" Рабочие мира, объединяйтесь!", - NULL - }; - - - static const char *logo1[] = { -" ╔═══════════════════╗", -" ║ ║", -" ║ ☭ C C C P ☭ ║", -" ║ ║", -" ╚═══════════════════╝", -" Власть — Советам!", - NULL - }; - - if (index < 0 || index >= MAX_LOGOS) return NULL; - - switch (index) { - case 0: - return logo0; - case 1: - return logo1; - default: - return NULL; - } -} - -int get_line_length(const char **line) { - size_t length = 0; - size_t max_length = 0; - - if (line == NULL) return -1; - for (int i = 0; line[i] != NULL; i++) { - length = strlen(line[i]); - - if (length > max_length) { - max_length = length; - } - } - return max_length; -} - -void print_logo(void) { - int length = 0; - - for (int i = 0; i < MAX_LOGOS; i++) { - const char **lines = logo(i); - if (lines == NULL) continue; - - length = get_line_length(lines); - - for (int j = 0; lines[j] != NULL ; j++) { - printf("%s\n", lines[j]); - } - printf("%d\n", length); - } -} diff --git a/src/logo/logo.h b/src/logo/logo.h deleted file mode 100644 index fc55db6..0000000 --- a/src/logo/logo.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef LOGO_H -#define LOGO_H - -void print_logo(void); - -#endif //LOGO_H |
