1 /* gEDA - GPL Electronic Design Automation
2 * gnetlist - gEDA Netlist
3 * Copyright (C) 1998-2010 Ales Hvezda
4 * Copyright (C) 1998-2020 gEDA Contributors (see ChangeLog for details)
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
37 #include <libgeda/libgeda.h>
39 #include "../include/globals.h"
40 #include "../include/i_vars.h"
41 #include "../include/prototype.h"
42 #include "../include/gettext.h"
44 SCM
g_rc_gnetlist_version(SCM scm_version
)
49 SCM_ASSERT (scm_is_string (scm_version
), scm_version
,
50 SCM_ARG1
, "gnetlist-version");
52 version
= scm_to_utf8_string (scm_version
);
53 if (strcmp (version
, PACKAGE_DATE_VERSION
) != 0) {
55 "You are running gEDA/gaf version [%s%s.%s],\n"
56 "but you have a version [%s] gnetlistrc file:\n[%s]\n"
57 "Please be sure that you have the latest rc file.\n"),
58 PREPEND_VERSION_STRING
, PACKAGE_DOTTED_VERSION
,
59 PACKAGE_DATE_VERSION
, version
, rc_filename
);
68 SCM
g_rc_net_naming_priority(SCM mode
)
70 static const vstbl_entry mode_table
[] = {
71 {NETATTRIB_ATTRIBUTE
, "netattrib"},
72 {NETNAME_ATTRIBUTE
, "netname"}
75 RETURN_G_RC_MODE("net-naming-priority", default_net_naming_priority
,
79 SCM
g_rc_hierarchy_traversal(SCM mode
)
81 static const vstbl_entry mode_table
[] = {
86 RETURN_G_RC_MODE("hierarchy-traversal", default_hierarchy_traversal
,
90 SCM
g_rc_hierarchy_uref_mangle(SCM mode
)
92 static const vstbl_entry mode_table
[] = {
97 RETURN_G_RC_MODE("hierarchy-uref-mangle",
98 default_hierarchy_uref_mangle
, 2);
101 SCM
g_rc_hierarchy_netname_mangle(SCM mode
)
103 static const vstbl_entry mode_table
[] = {
108 RETURN_G_RC_MODE("hierarchy-netname-mangle",
109 default_hierarchy_netname_mangle
, 2);
112 SCM
g_rc_hierarchy_netattrib_mangle(SCM mode
)
114 static const vstbl_entry mode_table
[] = {
119 RETURN_G_RC_MODE("hierarchy-netattrib-mangle",
120 default_hierarchy_netattrib_mangle
, 2);
124 g_strdup_scm_string(SCM scm_s
)
128 s
= scm_to_utf8_string (scm_s
);
134 SCM
g_rc_hierarchy_netname_separator(SCM name
)
136 SCM_ASSERT (scm_is_string (name
), name
,
137 SCM_ARG1
, "hierarchy-netname-separator");
139 g_free(default_hierarchy_netname_separator
);
141 default_hierarchy_netname_separator
= g_strdup_scm_string (name
);
146 SCM
g_rc_hierarchy_netattrib_separator(SCM name
)
148 SCM_ASSERT (scm_is_string (name
), name
,
149 SCM_ARG1
, "hierarchy-netattrib-separator");
151 g_free(default_hierarchy_netattrib_separator
);
153 default_hierarchy_netattrib_separator
= g_strdup_scm_string (name
);
158 SCM
g_rc_hierarchy_uref_separator(SCM name
)
160 SCM_ASSERT (scm_is_string (name
), name
,
161 SCM_ARG1
, "hierarchy-uref-separator");
163 g_free(default_hierarchy_uref_separator
);
165 default_hierarchy_uref_separator
= g_strdup_scm_string (name
);
170 SCM
g_rc_hierarchy_netattrib_order(SCM mode
)
172 static const vstbl_entry mode_table
[] = {
173 {PREPEND
, "prepend"},
177 RETURN_G_RC_MODE("hierarchy-netattrib-order",
178 default_hierarchy_netattrib_order
, 2);
181 SCM
g_rc_hierarchy_netname_order(SCM mode
)
183 static const vstbl_entry mode_table
[] = {
184 {PREPEND
, "prepend"},
188 RETURN_G_RC_MODE("hierarchy-netname-order",
189 default_hierarchy_netname_order
, 2);
192 SCM
g_rc_hierarchy_uref_order(SCM mode
)
194 static const vstbl_entry mode_table
[] = {
195 {PREPEND
, "prepend"},
199 RETURN_G_RC_MODE("hierarchy-uref-order",
200 default_hierarchy_uref_order
, 2);
203 SCM
g_rc_unnamed_netname(SCM name
)
205 SCM_ASSERT (scm_is_string (name
), name
,
206 SCM_ARG1
, "unamed-netname");
208 g_free(default_unnamed_netname
);
210 default_unnamed_netname
= g_strdup_scm_string (name
);
215 SCM
g_rc_unnamed_busname(SCM name
)
217 SCM_ASSERT (scm_is_string (name
), name
,
218 SCM_ARG1
, "unamed-busname");
220 g_free(default_unnamed_busname
);
222 default_unnamed_busname
= g_strdup_scm_string (name
);
228 /*************************** GUILE end done *********************************/