/[guile]/guile/guile-core/doc/ref/scheme-utility.texi
ViewVC logotype

Diff of /guile/guile-core/doc/ref/scheme-utility.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.6 by ossau, Sat Mar 16 13:35:23 2002 UTC revision 1.1.2.7 by ossau, Thu Sep 19 20:42:12 2002 UTC
# Line 490  The ordering of the list of procedures r Line 490  The ordering of the list of procedures r
490  matches the order in which those procedures would be called if the hook  matches the order in which those procedures would be called if the hook
491  was run using @code{run-hook}.  was run using @code{run-hook}.
492    
493    Note that the C functions in the following entries are for handling
494    @dfn{Scheme-level} hooks in C.  There are also @dfn{C-level} hooks which
495    have their own interface (@pxref{C Hooks}).
496    
497  @deffn {Scheme Procedure} make-hook [n_args]  @deffn {Scheme Procedure} make-hook [n_args]
498  @deffnx {C Function} scm_make_hook (n_args)  @deffnx {C Function} scm_make_hook (n_args)
499  Create a hook for storing procedure of arity @var{n_args}.  Create a hook for storing procedure of arity @var{n_args}.
# Line 551  that @var{hook} is actually a hook objec Line 555  that @var{hook} is actually a hook objec
555  well-formed list matching the arity of the hook.  well-formed list matching the arity of the hook.
556  @end deftypefn  @end deftypefn
557    
558    For C code, @code{SCM_HOOKP} is a faster alternative to
559    @code{scm_hook_p}:
560    
561    @deftypefn {C Macro} int SCM_HOOKP (x)
562    Return 1 if @var{x} is a Scheme-level hook, 0 otherwise.
563    @end deftypefn
564    
565    
566    @subsection Handling Scheme-level hooks from C code
567    
568    Here is an example of how to handle Scheme-level hooks from C code using
569    the above functions.
570    
571    @example
572    if (SCM_NFALSEP (scm_hook_p (obj)))
573      /* handle Scheme-level hook using C functions */
574      scm_reset_hook_x (obj);
575    else
576      /* do something else (obj is not a hook) */
577    @end example
578    
579    
580  @node C Hooks  @node C Hooks
581  @subsection Hooks For C Code.  @subsection Hooks For C Code.

Legend:
Removed from v.1.1.2.6  
changed lines
  Added in v.1.1.2.7

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26