From a65295fbebe1244a4b172d547ca77510dc19a529 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Wed, 25 Sep 2019 18:25:12 +0200 Subject: [PATCH] remove now unneeded mapping parser completely --- command-line.c | 1 - include/gds-render/layer/mapping-parser.h | 49 -------------- layer/layer-selector.c | 1 - layer/mapping-parser.c | 81 ----------------------- 4 files changed, 132 deletions(-) delete mode 100644 include/gds-render/layer/mapping-parser.h delete mode 100644 layer/mapping-parser.c diff --git a/command-line.c b/command-line.c index a27e4d0..4e75ec6 100644 --- a/command-line.c +++ b/command-line.c @@ -32,7 +32,6 @@ #include #include -#include #include #include #include diff --git a/include/gds-render/layer/mapping-parser.h b/include/gds-render/layer/mapping-parser.h deleted file mode 100644 index 2b77fbc..0000000 --- a/include/gds-render/layer/mapping-parser.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * GDSII-Converter - * Copyright (C) 2018 Mario Hüttel - * - * This file is part of GDSII-Converter. - * - * GDSII-Converter is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * GDSII-Converter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GDSII-Converter. If not, see . - */ - -/** - * @file mapping-parser.h - * @brief Function to read a mapping file line and parse it. - * @author Mario Hüttel - */ - -#ifndef __MAPPING_PARSER_H__ -#define __MAPPING_PARSER_H__ - -/** - * @addtogroup Mapping-Parser - * @{ - */ - -#include - -#include -#include - -/** - * @brief Create Line for LayerMapping file with supplied information - * @param layer_element information - * @param line_buffer buffer to write to - * @param max_len Maximum length that cna be used in \p line_buffer - */ -void mapping_parser_gen_csv_line(LayerElement *layer_element, char *line_buffer, size_t max_len); - -/** @} */ - -#endif /* __MAPPING_PARSER_H__ */ diff --git a/layer/layer-selector.c b/layer/layer-selector.c index fcda12d..0f9b342 100644 --- a/layer/layer-selector.c +++ b/layer/layer-selector.c @@ -36,7 +36,6 @@ #include #include #include -#include struct _LayerSelector { /* Parent */ diff --git a/layer/mapping-parser.c b/layer/mapping-parser.c deleted file mode 100644 index 94d854a..0000000 --- a/layer/mapping-parser.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * - * GDSII-Converter - * Copyright (C) 2018 Mario Hüttel - * - * This file is part of GDSII-Converter. - * - * GDSII-Converter is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * GDSII-Converter is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GDSII-Converter. If not, see . - */ - -/** - * @file mapping-parser.c - * @brief Function to read a mapping file line and parse it. - * @author Mario Hüttel - */ - -/** - * @addtogroup Mapping-Parser - * @{ - */ - -#include - -void mapping_parser_gen_csv_line(LayerElement *layer_element, char *line_buffer, size_t max_len) -{ - int i; - GString *string; - gboolean export; - const gchar *name; - int layer; - GdkRGBA color; - - string = g_string_new_len(NULL, max_len-1); - - /* Extract values */ - export = layer_element_get_export(layer_element); - name = (const gchar*)layer_element_get_name(layer_element); - layer = layer_element_get_layer(layer_element); - layer_element_get_color(layer_element, &color); - - /* print values to line */ - g_string_printf(string, "%d:%lf:%lf:%lf:%lf:%d:%s\n", - layer, color.red, color.green, - color.blue, color.alpha, (export == TRUE ? 1 : 0), name); - /* Fix broken locale settings */ - for (i = 0; string->str[i]; i++) { - if (string->str[i] == ',') - string->str[i] = '.'; - } - - for (i = 0; string->str[i]; i++) { - if (string->str[i] == ':') - string->str[i] = ','; - } - - if (string->len > (max_len-1)) { - printf("Layer Definition too long. Please shorten Layer Name!!\n"); - line_buffer[0] = 0x0; - return; - } - - /* copy max_len bytes of string */ - strncpy(line_buffer, (char *)string->str, max_len-1); - line_buffer[max_len-1] = 0; - - /* Completely remove string */ - g_string_free(string, TRUE); -} - -/** @} */ -