call.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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 __FUSION__CALL_H__
  24. #define __FUSION__CALL_H__
  25. #include <fusion/types.h>
  26. typedef enum {
  27. FCHR_RETURN,
  28. FCHR_RETAIN
  29. } FusionCallHandlerResult;
  30. typedef FusionCallHandlerResult (*FusionCallHandler) (int caller, /* fusion id of the caller */
  31. int call_arg, /* optional call parameter */
  32. void *call_ptr, /* optional call parameter */
  33. void *ctx, /* optional handler context */
  34. unsigned int serial,
  35. int *ret_val );
  36. typedef FusionCallHandlerResult (*FusionCallHandler3)(int caller, /* fusion id of the caller */
  37. int call_arg, /* optional call parameter */
  38. void *ptr, /* optional call parameter */
  39. unsigned int length,
  40. void *ctx, /* optional handler context */
  41. unsigned int serial,
  42. void *ret_ptr,
  43. unsigned int ret_size,
  44. unsigned int *ret_length );
  45. typedef struct {
  46. FusionWorldShared *shared;
  47. int call_id;
  48. FusionID fusion_id;
  49. FusionCallHandler handler;
  50. FusionCallHandler3 handler3;
  51. void *ctx;
  52. } FusionCall;
  53. DirectResult fusion_call_init ( FusionCall *call,
  54. FusionCallHandler handler,
  55. void *ctx,
  56. const FusionWorld *world );
  57. DirectResult fusion_call_init3 ( FusionCall *call,
  58. FusionCallHandler3 handler3,
  59. void *ctx,
  60. const FusionWorld *world );
  61. DirectResult fusion_call_execute( FusionCall *call,
  62. FusionCallExecFlags flags,
  63. int call_arg,
  64. void *call_ptr,
  65. int *ret_val );
  66. DirectResult fusion_call_execute3( FusionCall *call,
  67. FusionCallExecFlags flags,
  68. int call_arg,
  69. void *ptr,
  70. unsigned int length,
  71. void *ret_ptr,
  72. unsigned int ret_size,
  73. unsigned int *ret_length );
  74. DirectResult fusion_call_return ( FusionCall *call,
  75. unsigned int serial,
  76. int val );
  77. DirectResult fusion_call_return3( FusionCall *call,
  78. unsigned int serial,
  79. void *ptr,
  80. unsigned int length );
  81. DirectResult fusion_call_destroy( FusionCall *call );
  82. typedef enum {
  83. FUSION_CALL_PERMIT_NONE = 0x00000000,
  84. FUSION_CALL_PERMIT_EXECUTE = 0x00000001,
  85. FUSION_CALL_PERMIT_ALL = 0x00000001,
  86. } FusionCallPermissions;
  87. /*
  88. * Give permissions to another fusionee to use the call.
  89. */
  90. DirectResult fusion_call_add_permissions( FusionCall *call,
  91. FusionID fusion_id,
  92. FusionCallPermissions permissions );
  93. #endif