Mario Hüttel
6b03695824
* Move layer info struct and associated functions to dedicated c/h files. * Rename layer selector folder more generic "layer" Besides from restructuring nothing changes
59 lines
1.8 KiB
C
59 lines
1.8 KiB
C
/*
|
|
* 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/>.
|
|
*/
|
|
|
|
/**
|
|
* @file mapping-parser.h
|
|
* @brief Function to read a mapping file line and parse it.
|
|
* @author Mario Hüttel <mario.huettel@gmx.net>
|
|
*/
|
|
|
|
#ifndef __MAPPING_PARSER_H__
|
|
#define __MAPPING_PARSER_H__
|
|
|
|
/**
|
|
* @addtogroup MainApplication
|
|
* @{
|
|
*/
|
|
|
|
#include <gtk/gtk.h>
|
|
#include "widgets/layer-element.h"
|
|
|
|
/**
|
|
* @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
|
|
*/
|
|
int load_csv_line(GDataInputStream *stream, gboolean *export, char **name, int *layer, GdkRGBA *color);
|
|
|
|
/**
|
|
* @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);
|
|
|
|
/** @} */
|
|
|
|
#endif /* __MAPPING_PARSER_H__ */
|