conf.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. (c) Copyright 2001-2009 The world wide DirectFB Open Source Community (directfb.org)
  3. (c) Copyright 2000-2004 Convergence (integrated media) GmbH
  4. All rights reserved.
  5. Written by Denis Oliver Kropp <dok@directfb.org>,
  6. Andreas Hundt <andi@fischlustig.de>,
  7. Sven Neumann <neo@directfb.org>,
  8. Ville Syrjälä <syrjala@sci.fi> and
  9. Claudio Ciccani <klan@users.sf.net>.
  10. This library is free software; you can redistribute it and/or
  11. modify it under the terms of the GNU Lesser General Public
  12. License as published by the Free Software Foundation; either
  13. version 2 of the License, or (at your option) any later version.
  14. This library is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. Lesser General Public License for more details.
  18. You should have received a copy of the GNU Lesser General Public
  19. License along with this library; if not, write to the
  20. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  21. Boston, MA 02111-1307, USA.
  22. */
  23. #ifndef __DIRECT__CONF_H__
  24. #define __DIRECT__CONF_H__
  25. #include <direct/messages.h>
  26. #if HAVE_SIGNAL_H
  27. #include <signal.h>
  28. #else
  29. #include <sys/signal.h>
  30. #endif
  31. typedef enum {
  32. DCFL_NONE, /* None is fatal. */
  33. DCFL_ASSERT, /* ASSERT is fatal. */
  34. DCFL_ASSUME /* ASSERT and ASSUME are fatal. */
  35. } DirectConfigFatalLevel;
  36. typedef enum {
  37. DCTS_OTHER,
  38. DCTS_FIFO,
  39. DCTS_RR
  40. } DirectConfigThreadScheduler;
  41. struct __D_DirectConfig {
  42. DirectMessageType quiet;
  43. bool debug;
  44. bool trace;
  45. char *memcpy; /* Don't probe for memcpy routines to save a lot of
  46. startup time. Use this one instead if it's set. */
  47. char **disable_module; /* Never load these modules. */
  48. char *module_dir; /* module dir override */
  49. bool sighandler;
  50. sigset_t dont_catch; /* don't catch these signals */
  51. DirectLog *log;
  52. DirectConfigFatalLevel fatal;
  53. bool debugmem;
  54. bool thread_block_signals;
  55. bool fatal_break; /* Should D_BREAK() cause a trap? */
  56. int thread_priority;
  57. DirectConfigThreadScheduler thread_scheduler;
  58. int thread_stack_size;
  59. int thread_priority_scale;
  60. };
  61. extern DirectConfig *direct_config;
  62. extern const char *direct_config_usage;
  63. DirectResult direct_config_set( const char *name, const char *value );
  64. #endif