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

  1. /*========================================================================*/
  2. /*                                                                        */
  3. /*  smapi.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_API_H_INCLUDED
  14. #define SM_API_H_INCLUDED
  15.  
  16. /*------------------------------------------------------------------------*/
  17. /* Define the running speech manager API level                            */
  18. /*------------------------------------------------------------------------*/
  19. #define SM_API_VERSION_STRING  "4.0"
  20.  
  21. /*------------------------------------------------------------------------*/
  22. /* Define for parallel session handles.                                   */
  23. /*------------------------------------------------------------------------*/
  24. typedef void *SmSesId;
  25.  
  26. /*-------------------------------------------------------------------------*/
  27. /* speech manager includes to handle arguments, communication and access   */
  28. /* to reply messages                                                       */
  29. /*-------------------------------------------------------------------------*/
  30. #include <smrc.h>        /* SM_RC_... constants               */
  31. #include <smlimits.h>        /* SM_MAX_... constants               */
  32. #include <smcomm.h>        /* SM_MSG SM_[VOC]WORD & SM_... constants  */
  33. #include <smargs.h>        /* SmSetArg functions & SmN... constants   */
  34. #include <smmsg.h>        /* SmGet... access functions           */
  35. #include <smcallb.h>        /* SmAdd/RemoveCallback functions       */
  36.  
  37. /*-------------------------------------------------------------------------*/
  38. /* speech manager macros used by the application                           */
  39. /*-------------------------------------------------------------------------*/
  40. #define SmAsynchronous    ((SM_MSG *) 0)
  41.  
  42. /*------------------------------------------------------------------------*/
  43. /* put a wrapper around these functions so that they can be called from   */
  44. /* either C or C++ applications                                           */
  45. /*------------------------------------------------------------------------*/
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49.  
  50. /*-------------------------------------------------------------------------*/
  51. /* speech manager functions used by application                            */
  52. /*-------------------------------------------------------------------------*/
  53. int SmAddPronunciation    ( char          *spelling,
  54.                 char          *pronunciation,
  55.                 long           uttno,
  56.                             short          repetitions,
  57.                 long           options,
  58.                 SM_MSG        *reply );
  59.  
  60. int SmAddToVocab          ( char          *vocab,
  61.                 short          nvocwords,
  62.                             SM_VOCWORD    *vocwords[],
  63.                 SM_MSG        *reply );
  64.  
  65. int SmApiVersionCheck     ( char          *caller_version,
  66.                 char         **sm_version );
  67.  
  68. int SmCancelPlayback      ( SM_MSG        *reply );
  69.  
  70. int SmClose               ( void );
  71.  
  72. int SmConnect             ( int            nargs,
  73.                 SmArg         *Args,
  74.                 SM_MSG        *reply );
  75.  
  76. int SmCorrectText         ( short          nwords,
  77.                 SM_WORD       *words[],
  78.                 SM_MSG        *reply );
  79.  
  80. int SmCorrectTextCancel   ( SM_MSG        *reply );
  81.  
  82. int SmDefineGrammar       ( char          *vocab,
  83.                     char          *grammar,
  84.                 long           options,
  85.                     SM_MSG        *reply );
  86.  
  87. int SmDefineVocab         ( char          *vocab,
  88.                 short          nvocwords,
  89.                             SM_VOCWORD    *vocwords[],
  90.                 SM_MSG        *reply );
  91.  
  92. int SmDisableVocab        ( char          *vocab,
  93.                 SM_MSG        *reply );
  94.  
  95. int SmDiscardData         ( SM_MSG        *reply );
  96.  
  97. int SmDisconnect          ( int            nargs,
  98.                 SmArg         *Args,
  99.                 SM_MSG        *reply );
  100.  
  101. int SmDispatch            ( unsigned long  ap_val );
  102.  
  103. int SmDetachSessions      ( SM_MSG        *reply );
  104.  
  105. int SmEnableVocab         ( char          *vocab,
  106.                 SM_MSG        *reply );
  107.  
  108. int SmEventNotify         ( long           event_id,
  109.                 long           options,
  110.                 SM_MSG        *reply );
  111.  
  112. int SmHaltRecognizer      ( SM_MSG        *reply );
  113.  
  114. int SmMicOff              ( SM_MSG        *reply );
  115.  
  116. int SmMicOn               ( SM_MSG        *reply );
  117.  
  118. int SmNewContext          ( short          nwords,
  119.                 SM_WORD       *words[],
  120.                 SM_MSG        *reply );
  121.  
  122. int SmOpen                ( int            nargs,
  123.                 SmArg         *Args );
  124.  
  125. int SmPlayMessage         ( char          *message_name,
  126.                 char          *language,
  127.                 SM_MSG        *reply );
  128.  
  129. int SmPlayUtterance       ( long           uttno,
  130.                 long           begtime,
  131.                 long           endtime,
  132.                             SM_MSG        *reply );
  133.  
  134. int SmPlayWords           ( short          ntags,
  135.                 long           tags[],
  136.                 long           options,
  137.                             SM_MSG        *reply );
  138.  
  139. int SmQuery               ( short          item,
  140.                 SM_MSG        *reply );
  141.  
  142. int SmQueryAddedWords     ( char          *vocab,
  143.                 SM_MSG        *reply );
  144.  
  145. int SmQueryAlternates     ( short          ntags,
  146.                 long           tags[],
  147.                 SM_MSG        *reply);
  148.  
  149.  
  150. int SmQueryDefault        ( long           item,
  151.                 SM_MSG        *reply );
  152.  
  153. int SmQueryEnabledVocabs  ( SM_MSG        *reply );
  154.  
  155. int SmQueryEnrollIds      ( char          *user_id,
  156.                 char          *enroll_id,
  157.                 char          *language,
  158.                             SM_MSG        *reply );
  159.  
  160.  
  161. int SmQueryLanguages      ( SM_MSG        *reply );
  162.  
  163. int SmQueryPronunciation  ( char          *spelling,
  164.                 SM_MSG        *reply );
  165.  
  166. int SmQueryPronunciations ( SM_MSG        *reply );
  167.  
  168. int SmQuerySessions       ( SM_MSG        *reply );
  169.  
  170. int SmQuerySpeechData     ( SM_MSG        *reply );
  171.  
  172. int SmQueryTasks          ( char          *language,
  173.                 SM_MSG        *reply );
  174.  
  175. int SmQueryUserInfo       ( char          *user_id,
  176.                 char          *enroll_id,
  177.                 char          *itemname,
  178.                             SM_MSG        *reply );
  179.  
  180. int SmQueryUsers          ( SM_MSG        *reply );
  181.  
  182. int SmQueryVocabs         ( SM_MSG        *reply );
  183.  
  184. int SmQueryWord           ( SM_WORD       *word,
  185.                 SM_MSG        *reply );
  186.  
  187. int SmReceiveMsg          ( unsigned       long ap_val,
  188.                 SM_MSG        *reply );
  189.  
  190. int SmRecognizeNextWord   ( SM_MSG        *reply );
  191.  
  192. int SmReleaseFocus        ( SM_MSG        *reply );
  193.  
  194. int SmRemoveFromVocab     ( char          *vocab,
  195.                 short          nvocwords,
  196.                             SM_VOCWORD    *vocwords[],
  197.                 SM_MSG        *reply );
  198.  
  199. int SmRemovePronunciation ( char          *spelling,
  200.                 char          *pronunciation,
  201.                 SM_MSG        *reply );
  202.  
  203. int SmRequestFocus        ( SM_MSG        *reply );
  204.  
  205. int SmRequestMicOff       ( SM_MSG        *reply );
  206.  
  207. int SmRequestMicOn        ( SM_MSG        *reply );
  208.  
  209. int SmRestoreSpeechData   ( char          *archive,
  210.                 long           version,
  211.                 SM_MSG        *reply );
  212.  
  213. int SmSaveSpeechData      ( char          *archive,
  214.                 long           version,
  215.                 long           flags,
  216.                 SM_MSG        *reply );
  217.  
  218. int SmSet                 ( short          item,
  219.                 long           value,
  220.                 SM_MSG        *reply );
  221.  
  222. int SmSetDefault          ( long           item,
  223.                 char          *item_value,
  224.                 SM_MSG        *reply );
  225.  
  226. int SmSetUserInfo         ( char          *user_id,
  227.                 char          *enroll_id,
  228.                             char          *itemname,
  229.                 char          *itemvalue,
  230.                 SM_MSG        *reply );
  231.  
  232. int SmUndefineVocab       ( char          *vocab,
  233.                 SM_MSG        *reply );
  234.  
  235. int SmWordCorrection      ( short          ntags,
  236.                 long           tags[],
  237.                 short          nspells,
  238.                             char          *spellings[],
  239.                 char          *pronunciations[],
  240.                             short          new_pronunciation,
  241.                 SM_MSG        *reply );
  242.  
  243. /*------------------------------------------------------------------------*/
  244. /* Parallel sessions.                                                     */
  245. /*------------------------------------------------------------------------*/
  246. int SmSesAddPronunciation    ( SmSesId        session_id,
  247.                                char          *spelling,
  248.                    char          *pronunciation,
  249.                    long           uttno,
  250.                                short          repetitions,
  251.                    long           options,
  252.                    SM_MSG        *reply );
  253.  
  254. int SmSesAddToVocab          ( SmSesId        session_id,
  255.                                char          *vocab,
  256.                    short          nvocwords,
  257.                                SM_VOCWORD    *vocwords[],
  258.                    SM_MSG        *reply );
  259.  
  260. int SmSesCancelPlayback      ( SmSesId        session_id,
  261.                    SM_MSG        *reply );
  262.  
  263. int SmSesClose               ( SmSesId        session_id );
  264.  
  265. int SmSesConnect             ( SmSesId        session_id,
  266.                    int            nargs,
  267.                    SmArg         *Args,
  268.                    SM_MSG        *reply );
  269.  
  270. int SmSesDefineGrammar       ( SmSesId        session_id,
  271.                    char          *vocab,
  272.                    char          *grammar,
  273.                    long           options,
  274.                    SM_MSG        *reply );
  275.  
  276. int SmSesCorrectText         ( SmSesId        session_id,
  277.                                short          nwords,
  278.                    SM_WORD       *words[],
  279.                    SM_MSG        *reply );
  280.  
  281. int SmSesCorrectTextCancel   ( SmSesId        session_id,
  282.                    SM_MSG        *reply );
  283.  
  284. int SmSesDefineVocab         ( SmSesId        session_id,
  285.                                char          *vocab,
  286.                    short          nvocwords,
  287.                                SM_VOCWORD    *vocwords[],
  288.                    SM_MSG        *reply );
  289.  
  290. int SmSesDisableVocab        ( SmSesId        session_id,
  291.                                char          *vocab,
  292.                    SM_MSG        *reply );
  293.  
  294. int SmSesDiscardData         ( SmSesId        session_id,
  295.                    SM_MSG        *reply );
  296.  
  297. int SmSesDisconnect          ( SmSesId        session_id,
  298.                                int            nargs,
  299.                    SmArg         *Args,
  300.                    SM_MSG        *reply );
  301.  
  302. int SmSesDispatch            ( SmSesId        session_id,
  303.                    unsigned long  ap_val );
  304.  
  305. int SmSesDetachSessions      ( SmSesId        session_id,
  306.                    SM_MSG        *reply );
  307.  
  308. int SmSesEnableVocab         ( SmSesId        session_id,
  309.                    char          *vocab,
  310.                    SM_MSG        *reply );
  311.  
  312. int SmSesEventNotify         ( SmSesId        session_id,
  313.                    long           event_id,
  314.                    long           options,
  315.                    SM_MSG        *reply );
  316.  
  317. int SmSesHaltRecognizer      ( SmSesId        session_id,
  318.                    SM_MSG        *reply );
  319.  
  320. int SmSesMicOff              ( SmSesId        session_id,
  321.                    SM_MSG        *reply );
  322.  
  323. int SmSesMicOn               ( SmSesId        session_id,
  324.                    SM_MSG        *reply );
  325.  
  326. int SmSesNewContext          ( SmSesId        session_id,
  327.                    short          nwords,
  328.                    SM_WORD       *words[],
  329.                    SM_MSG        *reply );
  330.  
  331. int SmSesOpen                ( SmSesId       *session_id,
  332.                    int            nargs,
  333.                    SmArg         *Args );
  334.  
  335. int SmSesPlayMessage         ( SmSesId        session_id,
  336.                    char          *message_name,
  337.                    char          *language,
  338.                    SM_MSG        *reply );
  339.  
  340. int SmSesPlayUtterance       ( SmSesId        session_id,
  341.                    long           uttno,
  342.                    long           begtime,
  343.                    long           endtime,
  344.                                SM_MSG        *reply );
  345.  
  346. int SmSesPlayWords           ( SmSesId        session_id,
  347.                    short          ntags,
  348.                    long           tags[],
  349.                    long           options,
  350.                                SM_MSG        *reply );
  351.  
  352. int SmSesQuery               ( SmSesId        session_id,
  353.                    short          item,
  354.                    SM_MSG        *reply );
  355.  
  356. int SmSesQueryAddedWords     ( SmSesId        session_id,
  357.                    char          *vocab,
  358.                    SM_MSG        *reply );
  359.  
  360. int SmSesQueryAlternates     ( SmSesId        session_id,
  361.                    short          ntags,
  362.                    long           tags[],
  363.                    SM_MSG        *reply);
  364.  
  365. int SmSesQueryDefault        ( SmSesId        session_id,
  366.                    long           item,
  367.                    SM_MSG        *reply );
  368.  
  369. int SmSesQueryEnabledVocabs  ( SmSesId       session_id,
  370.                    SM_MSG        *reply );
  371.  
  372. int SmSesQueryEnrollIds      ( SmSesId        session_id,
  373.                    char          *user_id,
  374.                    char          *enroll_id,
  375.                    char          *language,
  376.                                SM_MSG        *reply );
  377.  
  378. int SmSesQueryLanguages      ( SmSesId        session_id,
  379.                    SM_MSG        *reply );
  380.  
  381. int SmSesQueryPronunciation  (SmSesId        session_id,
  382.                    char          *spelling,
  383.                    SM_MSG        *reply );
  384.  
  385. int SmSesQueryPronunciations ( SmSesId        session_id,
  386.                       SM_MSG        *reply );
  387.  
  388. int SmSesQuerySessions       ( SmSesId        session_id,
  389.                    SM_MSG        *reply );
  390.  
  391. int SmSesQuerySpeechData     ( SmSesId        session_id,
  392.                    SM_MSG        *reply );
  393.  
  394. int SmSesQueryTasks          ( SmSesId        session_id,
  395.                    char          *language,
  396.                    SM_MSG        *reply );
  397.  
  398. int SmSesQueryUserInfo       ( SmSesId        session_id,
  399.                    char          *user_id,
  400.                    char          *enroll_id,
  401.                    char          *itemname,
  402.                                SM_MSG        *reply );
  403.  
  404. int SmSesQueryUsers          ( SmSesId        session_id,
  405.                    SM_MSG        *reply );
  406.  
  407. int SmSesQueryVocabs         ( SmSesId        session_id,
  408.                    SM_MSG        *reply );
  409.  
  410. int SmSesQueryWord           ( SmSesId        session_id,
  411.                    SM_WORD       *word,
  412.                    SM_MSG        *reply );
  413.  
  414. int SmSesReceiveMsg          ( SmSesId        session_id,
  415.                    unsigned long  ap_val,
  416.                    SM_MSG        *reply );
  417.  
  418. int SmSesRecognizeNextWord   ( SmSesId        session_id,
  419.                    SM_MSG        *reply );
  420.  
  421. int SmSesReleaseFocus        ( SmSesId        session_id,
  422.                    SM_MSG        *reply );
  423.  
  424. int SmSesRemoveFromVocab     ( SmSesId        session_id,
  425.                    char          *vocab,
  426.                    short          nvocwords,
  427.                                SM_VOCWORD    *vocwords[],
  428.                    SM_MSG        *reply );
  429.  
  430. int SmSesRemovePronunciation ( SmSesId       session_id,
  431.                    char          *spelling,
  432.                    char          *pronunciation,
  433.                    SM_MSG        *reply );
  434.  
  435. int SmSesRequestFocus        ( SmSesId        session_id,
  436.                    SM_MSG        *reply );
  437.  
  438. int SmSesRequestMicOff       ( SmSesId        session_id,
  439.                    SM_MSG        *reply );
  440.  
  441. int SmSesRequestMicOn        ( SmSesId        session_id,
  442.                    SM_MSG        *reply );
  443.  
  444. int SmSesRestoreSpeechData   ( SmSesId        session_id,
  445.                    char          *archive,
  446.                    long           version,
  447.                    SM_MSG        *reply );
  448.  
  449. int SmSesSaveSpeechData      ( SmSesId        session_id,
  450.                    char          *archive,
  451.                    long           version,
  452.                    long           flags,
  453.                    SM_MSG        *reply );
  454.  
  455. int SmSesSet                 ( SmSesId        session_id,
  456.                    short          item,
  457.                    long           value,
  458.                    SM_MSG        *reply );
  459.  
  460. int SmSesSetDefault          ( SmSesId        session_id,
  461.                    long           item,
  462.                    char          *item_value,
  463.                    SM_MSG        *reply );
  464.  
  465. int SmSesSetUserInfo         ( SmSesId        session_id,
  466.                    char          *user_id,
  467.                    char          *enroll_id,
  468.                                char          *itemname,
  469.                    char          *itemvalue,
  470.                    SM_MSG        *reply );
  471.  
  472. int SmSesUndefineVocab       ( SmSesId        session_id,
  473.                    char          *vocab,
  474.                    SM_MSG        *reply );
  475.  
  476. int SmSesWordCorrection      ( SmSesId        session_id,
  477.                    short          ntags,
  478.                    long           tags[],
  479.                    short          nspells,
  480.                                char          *spellings[],
  481.                    char          *pronunciations[],
  482.                                short          new_pronunciation,
  483.                    SM_MSG        *reply );
  484.  
  485. #ifdef __cplusplus
  486.    }
  487. #endif
  488.  
  489. #endif /* not SM_API_H_INCLUDED */
  490.