home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / speech / h / smcallb.h < prev    next >
Text File  |  1999-05-11  |  5KB  |  103 lines

  1. /*========================================================================*/
  2. /*                                                                        */
  3. /*  smcallb.h                                                             */
  4. /*                                                                        */
  5. /*   (C) COPYRIGHT International Business Machines Corp. 1992,1996        */
  6. /*   All Rights Reserved                                                  */
  7. /*   Licensed Materials - Property of IBM                                 */
  8. /*   US Government Users Restricted Rights - Use, duplication or          */
  9. /*   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.    */
  10. /*                                                                        */
  11. /*========================================================================*/
  12.  
  13. #ifndef SM_CALLB_H_INCLUDED
  14. #define SM_CALLB_H_INCLUDED
  15.  
  16. /*-------------------------------------------------------------------------*/
  17. /* public macros for the speech manager callback interface                 */
  18. /*-------------------------------------------------------------------------*/
  19.  
  20. /*------------------------------------------------------------------------*/
  21. /* Speech Manager Callback handler definition. Sample looks like:         */
  22. /*                                                                        */
  23. /* SmHandler Callback_Handler ( SM_MSG  reply,       message from speech  */
  24. /*                                                   manager              */
  25. /*                              caddr_t client_data, data supplied during */
  26. /*                                                   registration to      */
  27. /*                                                   message dispatcher   */
  28. /*                              caddr_t call_data);  dynamic data         */
  29. /*                                                   supplied by message  */
  30. /*                                                   dispatcher           */
  31. /*------------------------------------------------------------------------*/
  32.  
  33. typedef int    SmHandler;
  34.  
  35. #ifndef _AIX
  36. typedef    char*    caddr_t;
  37. #else
  38. #include <sys/types.h>
  39. #endif
  40.  
  41. /*------------------------------------------------------------------------*/
  42. /* callback reasons                                                       */
  43. /*------------------------------------------------------------------------*/
  44. #define SmCR_RECV_ERROR                    1
  45. #define SmCR_REPLY_MESSAGE                 2
  46.  
  47. /*------------------------------------------------------------------------*/
  48. /* Reply message structure.                                               */
  49. /*------------------------------------------------------------------------*/
  50. typedef struct {
  51.  int                   reason;
  52.  SmSesId               ses_id;
  53.  char                 *app_name;
  54.  char                 *reply_name;
  55.  int                   reply_rc;
  56. } SmReplyMessageStruct;
  57.  
  58. /*------------------------------------------------------------------------*/
  59. /* put a wrapper around these functions so that they can be called from   */
  60. /* either C or C++ applications                                           */
  61. /*------------------------------------------------------------------------*/
  62. #ifdef __cplusplus
  63. extern "C" {
  64. #endif
  65.  
  66. /*------------------------------------------------------------------------*/
  67. /* function prototypes for the setting of callbacks                       */
  68. /*------------------------------------------------------------------------*/
  69. int SmAddCallback      ( char            *reply_name,
  70.                          SmHandler       (*handler) ( SM_MSG  reply,
  71.                                                       caddr_t client,
  72.                                                       caddr_t call ),
  73.                          caddr_t          client_data );
  74.  
  75. int SmSesAddCallback   ( SmSesId          session_id,
  76.                          char            *reply_name,
  77.                          SmHandler       (*handler) ( SM_MSG reply,
  78.                                           caddr_t client,
  79.                                   caddr_t call ),
  80.                          caddr_t          client_data );
  81.  
  82. /*------------------------------------------------------------------------*/
  83. /* function prototypes for the remove of callbacks                        */
  84. /*------------------------------------------------------------------------*/
  85. int SmRemoveCallback     ( char            *reply_name,
  86.                            SmHandler       (*handler) ( SM_MSG  reply,
  87.                                                         caddr_t client,
  88.                             caddr_t call ),
  89.                            caddr_t          client_data );
  90.  
  91. int SmSesRemoveCallback  ( SmSesId          session_id,
  92.                            char            *reply_name,
  93.                            SmHandler       (*handler) ( SM_MSG  reply,
  94.                                  caddr_t client,
  95.                                 caddr_t call ),
  96.                caddr_t          client_data );
  97.  
  98. #ifdef __cplusplus
  99.    }
  100. #endif
  101.  
  102. #endif /* not SM_CALLB_H_INCLUDED */
  103.