[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [guile/scwm] SCM_HOOKP changed?
From: |
Thien-Thi Nguyen |
Subject: |
Re: [guile/scwm] SCM_HOOKP changed? |
Date: |
Sun, 15 Sep 2002 14:28:16 -0700 |
From: Thien-Thi Nguyen <address@hidden>
Date: Sun, 15 Sep 2002 13:56:54 -0700
they should be removed
to emphasize the two different systems.
actually removal just obfuscates. this is better:
2002-09-15 Thien-Thi Nguyen <address@hidden>
* scheme-utility.twerp (Hook Reference): Mention and pxref C-level
hooks.
(C Hooks): Add subsection "Handling Scheme-level hooks from C code".
see below for diff.
thi
______________________________________________
Index: scheme-utility.twerp
===================================================================
RCS file: /home/ttn/cvs/guile-core/doc/ref/scheme-utility.twerp,v
retrieving revision 1.4
diff -w -c -b -c -p -r1.4 scheme-utility.twerp
*** scheme-utility.twerp 29 Aug 2002 05:34:05 -0000 1.4
--- scheme-utility.twerp 15 Sep 2002 21:21:56 -0000
*************** The ordering of the list of procedures r
*** 402,407 ****
--- 402,411 ----
matches the order in which those procedures would be called if the hook
was run using @code{run-hook}.
+ Note that the following C functions are for handling
+ @dfn{Scheme-level} hooks in C; there are also @dfn{C-level} hooks
+ which have their own interface (@pxref{C Hooks}).
+
@twerpdoc (make-hook (C scm_make_hook))
@twerpdoc (hook? (C scm_hook_p))
*************** function's closure data, and the call cl
*** 529,534 ****
--- 533,556 ----
@code{scm_c_hook_run}'s return value is the return value of the last
function to be called.
+ @end deftypefn
+
+ @subsection Handling Scheme-level hooks from C code
+
+ To handle Scheme-level hooks from C code you must use the appropriate
+ C functions (@pxref{Hook Reference}). For example:
+
+ @example
+ if (SCM_HOOKP (obj))
+ /* handle C-level hook */
+ else if (scm_hook_p (obj))
+ /* handle Scheme-level hook using C functions */
+ else
+ /* do something else (obj is not a hook) */
+ @end example
+
+ @deftypefn {C Macro} int SCM_HOOKP (x)
+ Return 1 if @var{x} is a C-level hook and 0 otherwise.
@end deftypefn
Re: [guile/scwm] SCM_HOOKP changed?, Marius Vollmer, 2002/09/15