1 /* gEDA - GPL Electronic Design Automation
2 * gnetlist - gEDA Netlist
3 * Copyright (C) 1998-2010 Ales Hvezda
4 * Copyright (C) 1998-2010 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
38 #include <libgeda/libgeda.h>
40 #include "../include/globals.h"
41 #include "../include/i_vars.h"
42 #include "../include/prototype.h"
44 #ifdef HAVE_LIBDMALLOC
48 SCM
g_rc_gnetlist_version(SCM scm_version
)
53 SCM_ASSERT (scm_is_string (scm_version
), scm_version
,
54 SCM_ARG1
, "gnetlist-version");
56 version
= scm_to_utf8_string (scm_version
);
57 if (strcmp (version
, PACKAGE_DATE_VERSION
) != 0) {
59 "You are running gEDA/gaf version [%s%s.%s],\n",
60 PREPEND_VERSION_STRING
, PACKAGE_DOTTED_VERSION
,
61 PACKAGE_DATE_VERSION
);
63 "but you have a version [%s] gnetlistrc file:\n[%s]\n",
64 version
, rc_filename
);
66 "Please be sure that you have the latest rc file.\n");
75 SCM
g_rc_net_naming_priority(SCM mode
)
77 static const vstbl_entry mode_table
[] = {
78 {NETATTRIB_ATTRIBUTE
, "netattrib"},
79 {NETNAME_ATTRIBUTE
, "netname"}
82 RETURN_G_RC_MODE("net-naming-priority", default_net_naming_priority
,
86 SCM
g_rc_hierarchy_traversal(SCM mode
)
88 static const vstbl_entry mode_table
[] = {
93 RETURN_G_RC_MODE("hierarchy-traversal", default_hierarchy_traversal
,
97 SCM
g_rc_hierarchy_uref_mangle(SCM mode
)
99 static const vstbl_entry mode_table
[] = {
104 RETURN_G_RC_MODE("hierarchy-uref-mangle",
105 default_hierarchy_uref_mangle
, 2);
108 SCM
g_rc_hierarchy_netname_mangle(SCM mode
)
110 static const vstbl_entry mode_table
[] = {
115 RETURN_G_RC_MODE("hierarchy-netname-mangle",
116 default_hierarchy_netname_mangle
, 2);
119 SCM
g_rc_hierarchy_netattrib_mangle(SCM mode
)
121 static const vstbl_entry mode_table
[] = {
126 RETURN_G_RC_MODE("hierarchy-netattrib-mangle",
127 default_hierarchy_netattrib_mangle
, 2);
131 g_strdup_scm_string(SCM scm_s
)
135 s
= scm_to_utf8_string (scm_s
);
141 SCM
g_rc_hierarchy_netname_separator(SCM name
)
143 SCM_ASSERT (scm_is_string (name
), name
,
144 SCM_ARG1
, "hierarchy-netname-separator");
146 g_free(default_hierarchy_netname_separator
);
148 default_hierarchy_netname_separator
= g_strdup_scm_string (name
);
153 SCM
g_rc_hierarchy_netattrib_separator(SCM name
)
155 SCM_ASSERT (scm_is_string (name
), name
,
156 SCM_ARG1
, "hierarchy-netattrib-separator");
158 g_free(default_hierarchy_netattrib_separator
);
160 default_hierarchy_netattrib_separator
= g_strdup_scm_string (name
);
165 SCM
g_rc_hierarchy_uref_separator(SCM name
)
167 SCM_ASSERT (scm_is_string (name
), name
,
168 SCM_ARG1
, "hierarchy-uref-separator");
170 g_free(default_hierarchy_uref_separator
);
172 default_hierarchy_uref_separator
= g_strdup_scm_string (name
);
177 SCM
g_rc_hierarchy_netattrib_order(SCM mode
)
179 static const vstbl_entry mode_table
[] = {
180 {PREPEND
, "prepend"},
184 RETURN_G_RC_MODE("hierarchy-netattrib-order",
185 default_hierarchy_netattrib_order
, 2);
188 SCM
g_rc_hierarchy_netname_order(SCM mode
)
190 static const vstbl_entry mode_table
[] = {
191 {PREPEND
, "prepend"},
195 RETURN_G_RC_MODE("hierarchy-netname-order",
196 default_hierarchy_netname_order
, 2);
199 SCM
g_rc_hierarchy_uref_order(SCM mode
)
201 static const vstbl_entry mode_table
[] = {
202 {PREPEND
, "prepend"},
206 RETURN_G_RC_MODE("hierarchy-uref-order",
207 default_hierarchy_uref_order
, 2);
210 SCM
g_rc_unnamed_netname(SCM name
)
212 SCM_ASSERT (scm_is_string (name
), name
,
213 SCM_ARG1
, "unamed-netname");
215 g_free(default_unnamed_netname
);
217 default_unnamed_netname
= g_strdup_scm_string (name
);
222 SCM
g_rc_unnamed_busname(SCM name
)
224 SCM_ASSERT (scm_is_string (name
), name
,
225 SCM_ARG1
, "unamed-busname");
227 g_free(default_unnamed_busname
);
229 default_unnamed_busname
= g_strdup_scm_string (name
);
235 /*************************** GUILE end done *********************************/