unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* [guile/scwm] SCM_HOOKP changed?
@ 2002-09-15 13:01 P Pareit
  2002-09-15 20:56 ` Thien-Thi Nguyen
  2002-09-15 23:59 ` Marius Vollmer
  0 siblings, 2 replies; 8+ messages in thread
From: P Pareit @ 2002-09-15 13:01 UTC (permalink / raw)


Hey,

I have a lot of code depending on SCM_HOOKP, has SCM_HOOKP changed in any way?
I also seen it is not documented, so I guess it should not be used, is 
scm_hook_p the right alternative?

The following program should show my problem:

// make-hook test program
//

#include <stdio.h>
#include <libguile.h>

#ifndef SCM_MAGIC_SNARFER
#define SCWM_GLOBAL_HOOK(var, name, args, docstring) \
SCM var
#else
#define SCWM_GLOBAL_HOOK(var, name, args, docstring) \
SCM_VARIABLE_INIT(var, name, scm_make_hook(SCM_MAKINUM(args)))
#endif

SCWM_GLOBAL_HOOK(error_hook, "error-hook", 1, "...");

void inner_main(void* closure, int argc, char** argv)
{
#ifndef SCM_MAGIC_SNARFER
#include "main.x"
#endif
  if (!SCM_HOOKP(error_hook)) {
    fprintf(stderr, "SCM_HOOKP(error_hook) returns false!\n");
  }
  if (!scm_hook_p(error_hook)) {
    fprintf(stderr, "scm_hook_p(error_hook) returns false!\n");
  }
}

int main(int argc, char* argv[])
{
  scm_boot_guile(argc, argv, inner_main, NULL);
}

and can be compiled with the following Makefile:


test: main.o
	gcc -g -o test main.c `guile-config link`

main.o: main.c main.x
	gcc -g -c main.c `guile-config compile`

main.x: main.c
	guile-snarf -o main.x main.c

clean:
	rm -f *.o
	rm -f *.x

pieter;


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-09-19 20:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-15 13:01 [guile/scwm] SCM_HOOKP changed? P Pareit
2002-09-15 20:56 ` Thien-Thi Nguyen
2002-09-15 21:28   ` Thien-Thi Nguyen
2002-09-16  4:39     ` Thien-Thi Nguyen
2002-09-16  9:50     ` Marius Vollmer
2002-09-16 11:35       ` Thien-Thi Nguyen
2002-09-19 20:20         ` Neil Jerram
2002-09-15 23:59 ` Marius Vollmer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).