[aisleriot] guile: Move the aisleriot interface into a module
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aisleriot] guile: Move the aisleriot interface into a module
- Date: Sat, 3 Dec 2011 16:49:30 +0000 (UTC)
commit ac28587e7ee957f4753b76a1b7564f198afef5fa
Author: Christian Persch <chpe gnome org>
Date: Wed Nov 30 14:03:31 2011 +0100
guile: Move the aisleriot interface into a module
games/sol.scm | 2 +-
src/game.c | 29 ++++++++++++++++++++++++++---
2 files changed, 27 insertions(+), 4 deletions(-)
---
diff --git a/games/sol.scm b/games/sol.scm
index 9268939..9d7cafb 100644
--- a/games/sol.scm
+++ b/games/sol.scm
@@ -14,7 +14,7 @@
; You should have received a copy of the GNU General Public License
; along with this program. If not, see <http://www.gnu.org/licenses/>.
-(use-modules (ice-9 format))
+(use-modules (ice-9 format) (aisleriot interface))
;; Feature masks:
(define droppable-feature 1)
diff --git a/src/game.c b/src/game.c
index 128566d..cea6242 100644
--- a/src/game.c
+++ b/src/game.c
@@ -1052,7 +1052,7 @@ scm_delayed_call (SCM callback)
}
static void
-cscm_init (void)
+cscm_init (void *data G_GNUC_UNUSED)
{
/* Let the scheme side of things know about our C functions. */
scm_c_define_gsubr ("set-feature-word!", 1, 0, 0, scm_set_feature_word);
@@ -1080,6 +1080,30 @@ cscm_init (void)
scm_c_define_gsubr ("undo-set-sensitive", 1, 0, 0, scm_undo_set_sensitive);
scm_c_define_gsubr ("redo-set-sensitive", 1, 0, 0, scm_redo_set_sensitive);
scm_c_define_gsubr ("dealable-set-sensitive", 1, 0, 0, scm_dealable_set_sensitive);
+
+ scm_c_export ("set-feature-word!",
+ "get-feature-word",
+ "set-statusbar-message",
+ "reset-surface",
+ "add-slot",
+ "get-slot",
+ "set-cards-c!",
+ "set-slot-y-expansion!",
+ "set-slot-x-expansion!",
+ "set-lambda",
+ "aisleriot-random",
+ "click-to-move?",
+ "get-score",
+ "set-score!",
+ "get-timeout",
+ "set-timeout!",
+ "delayed-call",
+ "add-to-score!",
+ "_",
+ "undo-set-sensitive",
+ "redo-set-sensitive",
+ "dealable-set-sensitive",
+ NULL);
}
static void
@@ -1332,8 +1356,7 @@ aisleriot_game_class_init (AisleriotGameClass *klass)
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS));
- /* Initialise our scheme interfaces */
- cscm_init ();
+ scm_c_define_module ("aisleriot interface", cscm_init, NULL);
}
/* public API */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]