2018-05-10 01:43:14 +02:00
|
|
|
/*
|
2018-05-15 22:54:10 +02:00
|
|
|
* GDSII-Converter
|
2018-05-10 01:43:14 +02:00
|
|
|
* 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
|
2018-05-16 16:29:34 +02:00
|
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation.
|
2018-05-10 01:43:14 +02:00
|
|
|
*
|
2018-05-15 22:54:10 +02:00
|
|
|
* GDSII-Converter is distributed in the hope that it will be useful,
|
2018-05-10 01:43:14 +02:00
|
|
|
* 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-05-07 13:27:50 +02:00
|
|
|
#ifndef __GDSPARSE_H__
|
|
|
|
#define __GDSPARSE_H__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2018-05-07 15:57:47 +02:00
|
|
|
#include <glib.h>
|
2018-05-07 13:27:50 +02:00
|
|
|
|
|
|
|
#define CELL_NAME_MAX (100)
|
|
|
|
|
|
|
|
enum graphics_type {GRAPHIC_PATH = 0, GRAPHIC_POLYGON = 1};
|
|
|
|
|
|
|
|
struct gds_time_field {
|
2018-05-10 01:13:27 +02:00
|
|
|
uint16_t year;
|
|
|
|
uint16_t month;
|
|
|
|
uint16_t day;
|
|
|
|
uint16_t hour;
|
|
|
|
uint16_t minute;
|
|
|
|
uint16_t second;
|
2018-05-07 13:27:50 +02:00
|
|
|
};
|
|
|
|
struct gds_point {
|
2018-05-10 01:13:27 +02:00
|
|
|
int x;
|
|
|
|
int y;
|
2018-05-07 13:27:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct gds_graphics {
|
2018-05-10 01:13:27 +02:00
|
|
|
enum graphics_type type;
|
|
|
|
GList *vertices;
|
|
|
|
unsigned int path_width;
|
|
|
|
int width_absolute;
|
|
|
|
int16_t layer;
|
|
|
|
uint16_t datatype;
|
2018-05-07 13:27:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct gds_cell_instance {
|
2018-05-10 01:13:27 +02:00
|
|
|
char ref_name[CELL_NAME_MAX];
|
|
|
|
struct gds_cell *cell_ref;
|
|
|
|
struct gds_point origin;
|
|
|
|
int flipped;
|
|
|
|
double angle;
|
|
|
|
double magnification;
|
2018-05-07 13:27:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct gds_cell {
|
2018-05-10 01:13:27 +02:00
|
|
|
char name[CELL_NAME_MAX];
|
|
|
|
struct gds_time_field mod_time;
|
|
|
|
struct gds_time_field access_time;
|
|
|
|
GList *child_cells;
|
|
|
|
GList *graphic_objs;
|
2018-05-07 13:27:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct gds_library {
|
2018-05-10 01:13:27 +02:00
|
|
|
char name[CELL_NAME_MAX];
|
|
|
|
struct gds_time_field time;
|
|
|
|
double unit_to_meters;
|
|
|
|
GList *cells;
|
|
|
|
GList *cell_names;
|
2018-05-07 13:27:50 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-05-07 15:57:47 +02:00
|
|
|
int parse_gds_from_file(const char *filename, GList **library_array);
|
2018-05-08 15:00:37 +02:00
|
|
|
int clear_lib_list(GList **library_list);
|
2018-05-07 13:27:50 +02:00
|
|
|
|
|
|
|
#endif /* __GDSPARSE_H__ */
|