Updated copyright text/header in most source files.
[geda-gaf/peter-b.git] / gnetlist / src / g_rc.c
blobfd22ef40355203924d4455879c1abdb4a109c972
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., 59 Temple Place, Suite 330, Boston, MA 02111 USA
21 #include <config.h>
22 #include <version.h>
24 #include <stdio.h>
25 #include <ctype.h>
26 #include <sys/stat.h>
27 #ifdef HAVE_STRING_H
28 #include <string.h>
29 #endif
30 #ifdef HAVE_STDLIB_H
31 #include <stdlib.h>
32 #endif
33 #ifdef HAVE_UNISTD_H
34 #include <unistd.h>
35 #endif
37 #include <libgeda/libgeda.h>
39 #include "../include/globals.h"
40 #include "../include/i_vars.h"
41 #include "../include/prototype.h"
43 #ifdef HAVE_LIBDMALLOC
44 #include <dmalloc.h>
45 #endif
47 SCM g_rc_gnetlist_version(SCM version)
49 SCM_ASSERT (scm_is_string (version), version,
50 SCM_ARG1, "gnetlist-version");
52 if (strcmp (SCM_STRING_CHARS (version), PACKAGE_DATE_VERSION) != 0) {
53 fprintf(stderr,
54 "You are running gEDA/gaf version [%s%s.%s],\n",
55 PREPEND_VERSION_STRING, PACKAGE_DOTTED_VERSION,
56 PACKAGE_DATE_VERSION);
57 fprintf(stderr,
58 "but you have a version [%s] gnetlistrc file:\n[%s]\n",
59 SCM_STRING_CHARS (version), rc_filename);
60 fprintf(stderr,
61 "Please be sure that you have the latest rc file.\n");
62 return SCM_BOOL_F;
65 return SCM_BOOL_T;
69 SCM g_rc_net_naming_priority(SCM mode)
71 static const vstbl_entry mode_table[] = {
72 {NETATTRIB_ATTRIBUTE, "netattrib"},
73 {NETNAME_ATTRIBUTE, "netname"}
76 RETURN_G_RC_MODE("net-naming-priority", default_net_naming_priority,
77 2);
80 SCM g_rc_hierarchy_traversal(SCM mode)
82 static const vstbl_entry mode_table[] = {
83 {TRUE, "enabled"},
84 {FALSE, "disabled"}
87 RETURN_G_RC_MODE("hierarchy-traversal", default_hierarchy_traversal,
88 2);
91 SCM g_rc_hierarchy_uref_mangle(SCM mode)
93 static const vstbl_entry mode_table[] = {
94 {TRUE, "enabled"},
95 {FALSE, "disabled"}
98 RETURN_G_RC_MODE("hierarchy-uref-mangle",
99 default_hierarchy_uref_mangle, 2);
102 SCM g_rc_hierarchy_netname_mangle(SCM mode)
104 static const vstbl_entry mode_table[] = {
105 {TRUE, "enabled"},
106 {FALSE, "disabled"}
109 RETURN_G_RC_MODE("hierarchy-netname-mangle",
110 default_hierarchy_netname_mangle, 2);
113 SCM g_rc_hierarchy_netattrib_mangle(SCM mode)
115 static const vstbl_entry mode_table[] = {
116 {TRUE, "enabled"},
117 {FALSE, "disabled"}
120 RETURN_G_RC_MODE("hierarchy-netattrib-mangle",
121 default_hierarchy_netattrib_mangle, 2);
124 SCM g_rc_hierarchy_netname_separator(SCM name)
126 SCM_ASSERT (scm_is_string (name), name,
127 SCM_ARG1, "hierarchy-netname-separator");
129 g_free(default_hierarchy_netname_separator);
131 default_hierarchy_netname_separator = g_strdup (SCM_STRING_CHARS (name));
133 return SCM_BOOL_T;
136 SCM g_rc_hierarchy_netattrib_separator(SCM name)
138 SCM_ASSERT (scm_is_string (name), name,
139 SCM_ARG1, "hierarchy-netattrib-separator");
141 g_free(default_hierarchy_netattrib_separator);
143 default_hierarchy_netattrib_separator = g_strdup (SCM_STRING_CHARS (name));
145 return SCM_BOOL_T;
148 SCM g_rc_hierarchy_uref_separator(SCM name)
150 SCM_ASSERT (scm_is_string (name), name,
151 SCM_ARG1, "hierarchy-uref-separator");
153 g_free(default_hierarchy_uref_separator);
155 default_hierarchy_uref_separator = g_strdup (SCM_STRING_CHARS (name));
157 return SCM_BOOL_T;
160 SCM g_rc_hierarchy_netattrib_order(SCM mode)
162 static const vstbl_entry mode_table[] = {
163 {PREPEND, "prepend"},
164 {APPEND, "append"}
167 RETURN_G_RC_MODE("hierarchy-netattrib-order",
168 default_hierarchy_netattrib_order, 2);
171 SCM g_rc_hierarchy_netname_order(SCM mode)
173 static const vstbl_entry mode_table[] = {
174 {PREPEND, "prepend"},
175 {APPEND, "append"}
178 RETURN_G_RC_MODE("hierarchy-netname-order",
179 default_hierarchy_netname_order, 2);
182 SCM g_rc_hierarchy_uref_order(SCM mode)
184 static const vstbl_entry mode_table[] = {
185 {PREPEND, "prepend"},
186 {APPEND, "append"}
189 RETURN_G_RC_MODE("hierarchy-uref-order",
190 default_hierarchy_uref_order, 2);
193 SCM g_rc_unnamed_netname(SCM name)
195 SCM_ASSERT (scm_is_string (name), name,
196 SCM_ARG1, "unamed-netname");
198 g_free(default_unnamed_netname);
200 default_unnamed_netname = g_strdup (SCM_STRING_CHARS (name));
202 return SCM_BOOL_T;
205 SCM g_rc_unnamed_busname(SCM name)
207 SCM_ASSERT (scm_is_string (name), name,
208 SCM_ARG1, "unamed-busname");
210 g_free(default_unnamed_busname);
212 default_unnamed_busname = g_strdup (SCM_STRING_CHARS (name));
214 return SCM_BOOL_T;
218 /*************************** GUILE end done *********************************/