2018-07-23 17:00:37 +02:00
|
|
|
/*
|
|
|
|
* GDSII-Converter
|
|
|
|
* Copyright (C) 2018 Mario Hüttel <mario.huettel@gmx.net>
|
|
|
|
*
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2018-07-24 17:45:16 +02:00
|
|
|
/**
|
|
|
|
* @file mapping-parser.h
|
|
|
|
* @brief Function to read a mapping file line and parse it.
|
|
|
|
* @author Mario Hüttel <mario.huettel@gmx.net>
|
|
|
|
*/
|
|
|
|
|
2018-07-23 17:00:37 +02:00
|
|
|
#ifndef __MAPPING_PARSER_H__
|
|
|
|
#define __MAPPING_PARSER_H__
|
|
|
|
|
2018-07-24 17:45:16 +02:00
|
|
|
/**
|
|
|
|
* @addtogroup MainApplication
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2018-07-23 17:00:37 +02:00
|
|
|
#include <gtk/gtk.h>
|
2019-03-14 21:30:37 +01:00
|
|
|
#include "widgets/layer-element.h"
|
2018-07-23 17:00:37 +02:00
|
|
|
|
2018-07-24 17:45:16 +02:00
|
|
|
/**
|
|
|
|
* @brief Load a line from \p stream and parse try to parse it as layer information
|
|
|
|
* @param stream Input data stream
|
|
|
|
* @param export Layer shall be exported
|
|
|
|
* @param name Layer name. Free returned pointer after using.
|
|
|
|
* @param layer Layer number
|
|
|
|
* @param color RGBA color.
|
|
|
|
* @return 1 if malformatted line, 0 if parsing was successful and parameters are valid, -1 if file end
|
|
|
|
*/
|
2018-07-23 17:00:37 +02:00
|
|
|
int load_csv_line(GDataInputStream *stream, gboolean *export, char **name, int *layer, GdkRGBA *color);
|
|
|
|
|
2019-03-14 21:30:37 +01:00
|
|
|
/**
|
|
|
|
* @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 create_csv_line(LayerElement *layer_element, char *line_buffer, size_t max_len);
|
|
|
|
|
2018-07-24 17:45:16 +02:00
|
|
|
/** @} */
|
|
|
|
|
2018-07-23 17:00:37 +02:00
|
|
|
#endif /* __MAPPING_PARSER_H__ */
|