gp_mspol.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Copyright (C) 2001 artofcode LLC. All rights reserved.
  2. This software is provided AS-IS with no warranty, either express or
  3. implied.
  4. This software is distributed under license and may not be copied,
  5. modified or distributed except as expressly authorized under the terms
  6. of the license contained in the file LICENSE in this distribution.
  7. For more information about licensing, please refer to
  8. http://www.ghostscript.com/licensing/. For information on
  9. commercial licensing, go to http://www.artifex.com/licensing/ or
  10. contact Artifex Software, Inc., 101 Lucas Valley Road #110,
  11. San Rafael, CA 94903, U.S.A., +1(415)492-9861.
  12. */
  13. /* $Id: gp_mspol.c,v 1.5 2004/08/05 17:02:36 stefan Exp $ */
  14. /*
  15. * Microsoft Windows platform polling support for Ghostscript.
  16. *
  17. */
  18. #include "gx.h"
  19. #include "gp.h"
  20. #include "gpcheck.h"
  21. #include "iapi.h"
  22. #include "iref.h"
  23. #include "iminst.h"
  24. #include "imain.h"
  25. /* ------ Process message loop ------ */
  26. /*
  27. * Check messages and interrupts; return true if interrupted.
  28. * This is called frequently - it must be quick!
  29. */
  30. #ifdef CHECK_INTERRUPTS
  31. int
  32. gp_check_interrupts(const gs_memory_t *mem)
  33. {
  34. if(mem == NULL) {
  35. /* MAJOR HACK will NOT work in multithreaded environment */
  36. mem = gs_lib_ctx_get_non_gc_memory_t();
  37. }
  38. if (mem && mem->gs_lib_ctx && mem->gs_lib_ctx->poll_fn)
  39. return (*mem->gs_lib_ctx->poll_fn)(mem->gs_lib_ctx->caller_handle);
  40. return 0;
  41. }
  42. #endif