1 /* gEDA - GPL Electronic Design Automation
2 * libgeda - gEDA's library
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
33 #include "libgeda_priv.h"
35 #ifdef HAVE_LIBDMALLOC
49 static struct gsubr_t libgeda_funcs
[] = {
50 { "eval-protected", 1, 1, 0, g_scm_eval_protected
},
51 { "eval-string-protected", 1, 0, 0, g_scm_eval_string_protected
},
53 { "component-library", 1, 1, 0, g_rc_component_library
},
54 { "component-library-command", 3, 0, 0, g_rc_component_library_command
},
55 { "component-library-funcs", 3, 0, 0, g_rc_component_library_funcs
},
56 { "component-library-search", 1, 0, 0, g_rc_component_library_search
},
57 { "source-library", 1, 0, 0, g_rc_source_library
},
58 { "source-library-search", 1, 0, 0, g_rc_source_library_search
},
60 { "world-size", 3, 0, 0, g_rc_world_size
},
62 { "reset-component-library", 0, 0, 0, g_rc_reset_component_library
},
63 { "reset-source-library", 0, 0, 0, g_rc_reset_source_library
},
65 { "untitled-name", 1, 0, 0, g_rc_untitled_name
},
66 { "scheme-directory", 1, 0, 0, g_rc_scheme_directory
},
67 { "bitmap-directory", 1, 0, 0, g_rc_bitmap_directory
},
68 { "bus-ripper-symname", 1, 0, 0, g_rc_bus_ripper_symname
},
69 { "postscript-prolog", 1, 0, 0, g_rc_postscript_prolog
},
70 { "attribute-promotion", 1, 0, 0, g_rc_attribute_promotion
},
71 { "promote-invisible", 1, 0, 0, g_rc_promote_invisible
},
72 { "keep-invisible", 1, 0, 0, g_rc_keep_invisible
},
73 { "always-promote-attributes",1, 0, 0, g_rc_always_promote_attributes
},
74 { "print-color-map", 0, 1, 0, g_rc_print_color_map
},
75 { NULL
, 0, 0, 0, NULL
} };
77 /*! \brief Register all libgeda functions with scheme.
78 * \par Function Description
79 * Creates g_subr_t objects to make g_rc_* functions that are defined
80 * in g_rc.c visible to Scheme.
82 void g_register_libgeda_funcs (void)
84 struct gsubr_t
*tmp
= libgeda_funcs
;
86 while (tmp
->name
!= NULL
) {
87 scm_c_define_gsubr (tmp
->name
, tmp
->req
, tmp
->opt
, tmp
->rst
, tmp
->fnc
);
93 /*! \brief Register some libgeda directories with Scheme.
94 * \par Function Description
95 * Ensures that the default gEDA Scheme directory is added to the
99 g_register_libgeda_dirs (void)
103 scheme_dir
= g_build_filename (s_path_sys_data (), "scheme", NULL
);
104 g_rc_scheme_directory (scm_from_utf8_string (scheme_dir
));