add trap-name procedure
authorAndy Wingo <wingo@pobox.com>
Thu, 23 Sep 2010 15:18:50 +0000 (17:18 +0200)
committerAndy Wingo <wingo@pobox.com>
Thu, 23 Sep 2010 15:20:05 +0000 (17:20 +0200)
* module/system/vm/trap-state.scm (trap-name): New proc.

module/system/vm/trap-state.scm

index df553ba..591f842 100644 (file)
@@ -28,6 +28,7 @@
   #:use-module (system vm trace)
   #:export (list-traps
             trap-enabled?
+            trap-name
             enable-trap!
             disable-trap!
             delete-trap!
                (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?))