plugins: python-renderer: Add gds-render-module

This commit is contained in:
Mario Hüttel 2019-11-17 14:44:21 +01:00
parent a60fe6543e
commit d69d4f3f7e
3 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,38 @@
/*
* GDSII-Converter Python Plugin
* Copyright (C) 2019 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 gds-render-module.h
* @brief Header file for the gds-render python module implementation
* @author Mario Hüttel <mario.huettel@gmx.net>
*/
#ifndef __GDS_RENDER_MODULE_H__
#define __GDS_RENDER_MODULE_H__
/**
* @addtogroup python-renderer
* @{
*/
/** @} */
#endif /* __GDS_RENDER_MODULE_H__ */

View File

@ -0,0 +1,26 @@
/*
* GDSII-Converter Python Plugin
* Copyright (C) 2019 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 gds-render-module.c
* @brief Gds-render python module implementation
* @author Mario Hüttel <mario.huettel@gmx.net>
*/
#include <python-renderer/gds-render-module.h>

View File

@ -17,6 +17,11 @@
* along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file python-renderer/plugin-main.c
* @author Mario
*/
/**
* @defgroup python-plugin Python Plugin for External Renderer
* @ingroup plugins
@ -33,6 +38,8 @@
#include <gds-render/gds-utils/gds-types.h>
#include <gds-render/output-renderers/external-renderer-interfaces.h>
#include <python-renderer/gds-render-module.h>
/**
* @brief Global variable for loaded module. This is not very nice.
* @warning This has to be changed, if this api wants to be re-entrant.
@ -90,6 +97,7 @@ int FUNC_DECL(EXTERNAL_LIBRARY_INIT_FUNCTION)(const char *params, const char *ve
Py_Initialize();
if (!getcwd(cwd, sizeof(cwd))) {
fprintf(stderr, "Error getting current working directory. Maybe the path is too long?\n");
return -2;
}