From 6263b8722e33ed08b19b95046b881526a68c4dd3 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Thu, 23 Sep 2010 17:18:50 +0200 Subject: [PATCH] add trap-name procedure * module/system/vm/trap-state.scm (trap-name): New proc. --- module/system/vm/trap-state.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/module/system/vm/trap-state.scm b/module/system/vm/trap-state.scm index df553ba13..591f84209 100644 --- a/module/system/vm/trap-state.scm +++ b/module/system/vm/trap-state.scm @@ -28,6 +28,7 @@ #:use-module (system vm trace) #:export (list-traps trap-enabled? + trap-name enable-trap! disable-trap! delete-trap! @@ -161,6 +162,10 @@ (trap-wrapper-name wrapper))) (trap-state-wrappers trap-state))) +(define* (trap-name idx #:optional (trap-state (the-trap-state))) + (and=> (wrapper-at-index trap-state idx) + trap-wrapper-name)) + (define* (trap-enabled? idx #:optional (trap-state (the-trap-state))) (and=> (wrapper-at-index trap-state idx) trap-wrapper-enabled?))