appa.sgm 143 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619
  1. <!-- $XConsortium: appa.sgm /main/10 1996/10/30 15:15:26 rws $ -->
  2. <!-- (c) Copyright 1995 Digital Equipment Corporation. -->
  3. <!-- (c) Copyright 1995 Hewlett-Packard Company. -->
  4. <!-- (c) Copyright 1995 International Business Machines Corp. -->
  5. <!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
  6. <!-- (c) Copyright 1995 Novell, Inc. -->
  7. <!-- (c) Copyright 1995 FUJITSU LIMITED. -->
  8. <!-- (c) Copyright 1995 Hitachi. -->
  9. <Appendix Id="TTUG.MsgTk.div.1">
  10. <Title Id="TTUG.MsgTk.mkr.1">The Messaging Toolkit</Title>
  11. <Para>The ToolTalk Messaging Toolkit is a higher-level interface of the ToolTalk API.
  12. It provides common definitions and conventions to easily integrate basic
  13. ToolTalk messages and functionality into an application for optimum
  14. inter&hyphen;operability with other applications that follow the same message
  15. protocols.</Para>
  16. <Para>Although most of the messages in the ToolTalk Messaging Toolkit are the
  17. messages in the standard ToolTalk message sets, the functions of the Messaging
  18. Toolkit transparently take care of several tasks that would otherwise need to be
  19. coded separately. For example, the<IndexTerm>
  20. <Primary>ttdt_file_join</Primary>
  21. </IndexTerm>
  22. <Filename>ttdt_file_join</Filename> function will register a
  23. pattern to observe Deleted, Reverted, Moved, and Saved notices for the
  24. specified file in the specified scope; it also invokes a callback message.</Para>
  25. <Sect1 Id="TTUG.MsgTk.div.2">
  26. <Title>General Description of the ToolTalk Messaging Toolkit</Title>
  27. <Para>Inter&hyphen;operability is an important theme if independently developed
  28. applications are to work together. The messages in the toolkit have been agreed
  29. upon by developers of inter&hyphen;operating applications; the protocols form a small,
  30. well&hyphen;defined interface that maximizes application autonomy.</Para>
  31. <Para>The ToolTalk Messaging Toolkit plays a key role in application inter&hyphen;operability
  32. and offers complete support for messaging. The message protocol specification
  33. includes the set of messages and how applications should behave when they
  34. receive the messages. These messages can be retrofitted to any existing
  35. application to leverage the functionality of the application. You can easily add
  36. these messages to existing applications to send, receive, and use shared
  37. information.</Para>
  38. <Para>Tools that follow the ToolTalk messaging conventions will not use the same
  39. ToolTalk syntax for different semantics, nor will tools fail to talk to each other
  40. because they use different ToolTalk syntax for identical semantics. If these
  41. protocols are observed, cooperating applications can be modified, even
  42. replaced, without affecting one another.</Para>
  43. <Para>Most of the messages in the Messaging Toolkit are the messages in the
  44. standard ToolTalk message sets. For detailed descriptions of the standard
  45. ToolTalk message sets, see the <Emphasis>ToolTalk Reference Manual</Emphasis>.
  46. <!--Original XRef content: 'Table&numsp;A&hyphen;1'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.2"> lists the
  47. functions described in this chapter that partly comprise the ToolTalk
  48. Messaging Toolkit.</Para>
  49. <Table Id="TTUG.MsgTk.tbl.1" Frame="Topbot">
  50. <Title Id="TTUG.MsgTk.mkr.2">ToolTalk Messaging Toolkit Functions</Title>
  51. <TGroup Cols="2">
  52. <ColSpec Colname="1" Colwidth="2.5 in">
  53. <ColSpec Colname="2" Colwidth="2.5 in">
  54. <THead>
  55. <Row>
  56. <Entry><Para><Literal>Function</Literal></Para></Entry>
  57. <Entry><Para><Literal>Description</Literal></Para></Entry>
  58. </Row>
  59. </THead>
  60. <TBody>
  61. <Row>
  62. <Entry><Para><Command>ttdt_close</Command></Para></Entry>
  63. <Entry><Para><Emphasis>Destroys a ToolTalk communication
  64. endpoint</Emphasis></Para></Entry>
  65. </Row>
  66. <Row>
  67. <Entry><Para><Command>ttdt_file_event</Command></Para></Entry>
  68. <Entry><Para>Announces an event about a file</Para></Entry>
  69. </Row>
  70. <Row>
  71. <Entry><Para><Command>ttdt_file_join</Command></Para></Entry>
  72. <Entry><Para>Registers to observe ToolTalk events
  73. about a file</Para></Entry>
  74. </Row>
  75. <Row>
  76. <Entry><Para><Command>ttdt_file_notice</Command></Para></Entry>
  77. <Entry><Para>Creates and sends a standard ToolTalk
  78. notice about a file</Para></Entry>
  79. </Row>
  80. <Row>
  81. <Entry><Para><Command>ttdt_file_quit</Command></Para></Entry>
  82. <Entry><Para>Unregisters interest in ToolTalk events
  83. about a file</Para></Entry>
  84. </Row>
  85. <Row>
  86. <Entry><Para><Filename>ttdt_file_request</Filename></Para></Entry>
  87. <Entry><Para>Creates and sends a standard ToolTalk
  88. request about a file</Para></Entry>
  89. </Row>
  90. <Row>
  91. <Entry><Para><Command>ttdt_Get_Modified</Command></Para></Entry>
  92. <Entry><Para>Asks if any ToolTalk client has changes
  93. pending on a file</Para></Entry>
  94. </Row>
  95. <Row>
  96. <Entry><Para><Command>ttdt_message_accept</Command></Para></Entry>
  97. <Entry><Para>Accepts the responsibility for handling a
  98. ToolTalk request</Para></Entry>
  99. </Row>
  100. <Row>
  101. <Entry><Para><Command>ttdt_open</Command></Para></Entry>
  102. <Entry><Para>Creates a ToolTalk communication
  103. endpoint</Para></Entry>
  104. </Row>
  105. <Row>
  106. <Entry><Para><Command>ttdt_Revert</Command></Para></Entry>
  107. <Entry><Para>Requests that a ToolTalk client revert to
  108. the last saved version of a file</Para></Entry>
  109. </Row>
  110. <Row>
  111. <Entry><Para><Command>ttdt_Save</Command></Para></Entry>
  112. <Entry><Para>Requests that a ToolTalk client save a file</Para></Entry>
  113. </Row>
  114. <Row>
  115. <Entry><Para><Command>ttdt_sender_imprint_on</Command></Para></Entry>
  116. <Entry><Para>Causes a tool to emulate the behavior
  117. and characteristics of the specified
  118. ToolTalk tool</Para></Entry>
  119. </Row>
  120. <Row>
  121. <Entry><Para><Command>ttdt_session_join</Command></Para></Entry>
  122. <Entry><Para>Joins a ToolTalk session and registers
  123. patterns and default callbacks for many
  124. standard desktop messages</Para></Entry>
  125. </Row>
  126. <Row>
  127. <Entry><Para><Command>ttdt_session_quit</Command></Para></Entry>
  128. <Entry><Para>Unregisters any patterns and default
  129. callbacks registered when session joined,
  130. and quits the ToolTalk session</Para></Entry>
  131. </Row>
  132. <Row>
  133. <Entry><Para><Command>ttdt_subcontract_manage</Command></Para></Entry>
  134. <Entry><Para>Manages outstanding requests</Para></Entry>
  135. </Row>
  136. <Row>
  137. <Entry><Para><Filename>ttmedia_Deposit</Filename></Para></Entry>
  138. <Entry><Para>Sends a Deposit request to checkpoint a
  139. document</Para></Entry>
  140. </Row>
  141. <Row>
  142. <Entry><Para><Command>ttmedia_load</Command></Para></Entry>
  143. <Entry><Para>Creates and sends a Media Exchange
  144. request to display, edit, or compose a
  145. document</Para></Entry>
  146. </Row>
  147. <Row>
  148. <Entry><Para><Filename>ttmedia_load_reply</Filename></Para></Entry>
  149. <Entry><Para>Replies to a Display, Edit, or Compose
  150. request</Para></Entry>
  151. </Row>
  152. <Row>
  153. <Entry><Para><Command>ttmedia_ptype_declare</Command></Para></Entry>
  154. <Entry><Para>Declares the ptype of a Media Exchange
  155. media editor</Para></Entry>
  156. </Row>
  157. <Row>
  158. <Entry><Para><Filename>tttk_block_while</Filename></Para></Entry>
  159. <Entry><Para>Blocks the program while awaiting a
  160. condition such as a reply</Para></Entry>
  161. </Row>
  162. <Row>
  163. <Entry><Para><Filename>tttk_message_abandon</Filename></Para></Entry>
  164. <Entry><Para>Fails or rejects a message, then destroys it</Para></Entry>
  165. </Row>
  166. <Row>
  167. <Entry><Para><Command>tttk_message_create</Command></Para></Entry>
  168. <Entry><Para>Creates a message that conforms to
  169. messaging conventions</Para></Entry>
  170. </Row>
  171. <Row>
  172. <Entry><Para><Filename>tttk_message_fail</Filename></Para></Entry>
  173. <Entry><Para>Fails a message</Para></Entry>
  174. </Row>
  175. <Row>
  176. <Entry><Para><Filename>tttk_message_receive</Filename></Para></Entry>
  177. <Entry><Para>Retrieves next ToolTalk message</Para></Entry>
  178. </Row>
  179. <Row>
  180. <Entry><Para><Filename>tttk_message_reject</Filename></Para></Entry>
  181. <Entry><Para>Rejects a message</Para></Entry>
  182. </Row>
  183. <Row>
  184. <Entry><Para><Filename>tttk_op_string</Filename></Para></Entry>
  185. <Entry><Para>Returns a string for the operation</Para></Entry>
  186. </Row>
  187. <Row>
  188. <Entry><Para><Filename>tttk_string_op</Filename></Para></Entry>
  189. <Entry><Para>Returns the operation for the string</Para></Entry>
  190. </Row>
  191. <Row>
  192. <Entry><Para><Command>tttk_Xt_input_handler</Command></Para></Entry>
  193. <Entry><Para>Processes ToolTalk events for Xt clients</Para></Entry>
  194. </Row>
  195. </TBody>
  196. </TGroup>
  197. </Table>
  198. </Sect1>
  199. <Sect1 Id="TTUG.MsgTk.div.3">
  200. <Title>Toolkit Conventions</Title>
  201. <Para>Most of the messaging conventions for the toolkit consist of descriptions of the
  202. standard ToolTalk message sets. This section describes conventions not related
  203. to any particular standard message set.</Para>
  204. <Table Id="TTUG.MsgTk.tbl.2" Frame="Topbot">
  205. <Title>Messaging Toolkit Conventions</Title>
  206. <TGroup Cols="2">
  207. <ColSpec Colname="1" Colwidth="1.5 in">
  208. <ColSpec Colname="2" Colwidth="5.5 in">
  209. <THead>
  210. <Row>
  211. <Entry><Para><Literal>Field</Literal></Para></Entry>
  212. <Entry><Para><Literal>Description</Literal></Para></Entry>
  213. </Row>
  214. </THead>
  215. <TBody>
  216. <Row>
  217. <Entry><Para>fileAttrib</Para></Entry>
  218. <Entry><Para>Indicates whether the file attribute of the message can or needs to be set. The ToolTalk service
  219. allows each message to refer to a file, and has a mechanism (called &ldquo;file-scoping&rdquo;) for
  220. delivering messages to clients that are &ldquo;interested in&rdquo; the named file.</Para></Entry>
  221. </Row>
  222. <Row>
  223. <Entry><Para>opName</Para></Entry>
  224. <Entry><Para>The name of the operation or event (also called &ldquo;op&rdquo;). It is important that different tools use
  225. the same opName to mean the same thing. Unless a message is a standard one, its opName
  226. must be unique; for example, prefix the opName with <Filename>Company_Product</Filename> (such as
  227. <Symbol Role="Variable">Acme_HoarkTool_Hoark_My_Frammistat</Symbol>).</Para></Entry>
  228. </Row>
  229. <Row>
  230. <Entry><Para>requiredArgs</Para></Entry>
  231. <Entry><Para>Arguments that must always be included in the message.</Para></Entry>
  232. </Row>
  233. <Row>
  234. <Entry><Para>optionalArgs</Para></Entry>
  235. <Entry><Para>Extra arguments that may be included in a message. Any optional arguments in a message
  236. must be in the specified order and must follow the required arguments.</Para></Entry>
  237. </Row>
  238. <Row>
  239. <Entry><Para>vtype argumentName</Para></Entry>
  240. <Entry><Para>A description of a particular argument. A vtype is a programmer-defined string that describes
  241. what kind of data a message argument contains. The ToolTalk service uses vtypes only for
  242. matching sent message instances with registered message patterns. Every vtype should by
  243. convention map to a single, well-known data type.</Para></Entry>
  244. </Row>
  245. </TBody>
  246. </TGroup>
  247. </Table>
  248. </Sect1>
  249. <Sect1 Id="TTUG.MsgTk.div.4">
  250. <Title>Using the Messaging Toolkit When Writing Applications</Title>
  251. <Para>To use the toolkit, include the<IndexTerm>
  252. <Primary>ToolTalk messaging toolkit header file</Primary>
  253. </IndexTerm><IndexTerm>
  254. <Primary>files</Primary>
  255. <Secondary>ToolTalk messaging toolkit header</Secondary>
  256. </IndexTerm>
  257. ToolTalk Messaging Toolkit header file:</Para>
  258. <ProgramListing>#include &lt;Tt/tttk.h></ProgramListing>
  259. </Sect1>
  260. <Sect1 Id="TTUG.MsgTk.div.5">
  261. <Title>The ToolTalk Messaging Toolkit</Title>
  262. <Para>This section contains a description of functions that are part of the ToolTalk
  263. Messaging Toolkit.</Para>
  264. <Example Id="TTUG.MsgTk.tbl.3">
  265. <Title><IndexTerm>
  266. <Primary>ttdt_close</Primary>
  267. </IndexTerm><IndexTerm>
  268. <Primary>message sets</Primary>
  269. <Secondary>toolkit</Secondary>
  270. <Tertiary>ttdt_close</Tertiary>
  271. </IndexTerm><IndexTerm>
  272. <Primary>toolkit messages</Primary>
  273. <Secondary>ttdt_close</Secondary>
  274. </IndexTerm>ttdt_close</Title>
  275. <ProgramListing>Tt_status ttdt_close( const char * procid,
  276. const char * new_procid,
  277. int sendStopped );
  278. </ProgramListing>
  279. </Example>
  280. <Para>The <Filename>ttdt_close</Filename> function destroys a ToolTalk communication endpoint. This
  281. function calls the<IndexTerm>
  282. <Primary>ToolTalk functions</Primary>
  283. <Secondary>tt_close</Secondary>
  284. </IndexTerm><IndexTerm>
  285. <Primary>tt_close function</Primary>
  286. </IndexTerm>
  287. ToolTalk function <Filename>tt_close</Filename>.</Para>
  288. <ItemizedList Remap="Bullet1">
  289. <ListItem>
  290. <Para>If the value of <Command>procid</Command> is <Command>!= 0</Command>, this function calls</Para>
  291. </ListItem>
  292. </ItemizedList>
  293. <programlisting><IndexTerm><Primary>tt_default_procid_set( procid )</Primary></IndexTerm>tt_default_procid_set( procid )</ProgramListing>
  294. <ItemizedList Remap="Bullet1">
  295. <ListItem>
  296. <Para>If the value of <Filename>new_procid</Filename> is <Command>!= 0</Command>, this function calls</Para>
  297. </ListItem>
  298. </ItemizedList>
  299. <programlisting><IndexTerm><Primary>tt_default_procid_set( new_procid )</Primary></IndexTerm>tt_default_procid_set( new_procid )</ProgramListing>
  300. <ItemizedList Remap="Bullet1">
  301. <ListItem>
  302. <Para>If the <Command>sendStopped</Command> parameter is set, this function sends a<IndexTerm>
  303. <Primary>Stopped notice</Primary>
  304. </IndexTerm>
  305. Stopped notice.</Para>
  306. </ListItem>
  307. </ItemizedList>
  308. <Para>The <Filename>ttdt_close</Filename> function can return any error returned by the ToolTalk
  309. functions<IndexTerm>
  310. <Primary>tt_default_procid_set function</Primary>
  311. </IndexTerm><IndexTerm>
  312. <Primary>ToolTalk functions</Primary>
  313. <Secondary>tt_default_procid_set</Secondary>
  314. </IndexTerm>
  315. <Filename>tt_default_procid_set</Filename> and <Filename>tt_close</Filename>. If the Sending notice
  316. fails, no errors are propagated.</Para>
  317. <Example Id="TTUG.MsgTk.tbl.4">
  318. <Title><IndexTerm>
  319. <Primary>ttdt_file_event</Primary>
  320. </IndexTerm><IndexTerm>
  321. <Primary>message sets</Primary>
  322. <Secondary>toolkit</Secondary>
  323. <Tertiary>ttdt_file_event</Tertiary>
  324. </IndexTerm><IndexTerm>
  325. <Primary>toolkit messages</Primary>
  326. <Secondary>ttdt_file_event</Secondary>
  327. </IndexTerm>ttdt_file_event</Title>
  328. <ProgramListing>Tt_status ttdt_file_event( Tt_message context,
  329. Tttk_op event,
  330. Tt_pattern * patterns,
  331. int send );
  332. </ProgramListing>
  333. </Example>
  334. <Para>The <Filename>ttdt_file_event</Filename> function uses the ToolTalk service to announce an
  335. event about a file. This function creates and, optionally, sends a ToolTalk notice
  336. that announces an event pertaining to a specified file. This file is indicated in
  337. the path name that was passed to the<IndexTerm>
  338. <Primary>ttdt_file_join</Primary>
  339. </IndexTerm><IndexTerm>
  340. <Primary>message sets</Primary>
  341. <Secondary>toolkit</Secondary>
  342. <Tertiary>ttdt_file_join</Tertiary>
  343. </IndexTerm><IndexTerm>
  344. <Primary>toolkit messages</Primary>
  345. <Secondary>ttdt_file_join</Secondary>
  346. </IndexTerm>
  347. <Filename>ttdt_file_join</Filename> function when the
  348. <Command>patterns</Command> were created.</Para>
  349. <ItemizedList Remap="Bullet1">
  350. <ListItem>
  351. <Para><!--Original XRef content: 'Table&numsp;A&hyphen;3'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.3"> describes the effect of the value of the <Symbol Role="Variable">event</Symbol> parameter on the
  352. announcement made.</Para>
  353. </ListItem>
  354. </ItemizedList>
  355. <Table Id="TTUG.MsgTk.tbl.5" Frame="Topbot">
  356. <Title Id="TTUG.MsgTk.mkr.3">Effect of event Parameter</Title>
  357. <TGroup Cols="2">
  358. <ColSpec Colname="1" Colwidth="1.25 in">
  359. <ColSpec Colname="2" Colwidth="3.70041 in">
  360. <THead>
  361. <Row>
  362. <Entry><Para><Literal>Event Announced</Literal></Para></Entry>
  363. <Entry><Para><Literal>Announcement</Literal></Para></Entry>
  364. </Row>
  365. </THead>
  366. <TBody>
  367. <Row>
  368. <Entry><Para><Filename><IndexTerm>
  369. <Primary>TTDT_MODIFIED</Primary>
  370. </IndexTerm>TTDT_MODIFIED</Filename></Para></Entry>
  371. <Entry><Para>Registers in the scope passed to the <Filename>ttdt_file_join</Filename>
  372. function to announce the event to interested tools that handle<IndexTerm>
  373. <Primary>Get_Modified request</Primary>
  374. </IndexTerm>
  375. Get_Modified,<IndexTerm>
  376. <Primary>Save request</Primary>
  377. </IndexTerm>
  378. Save, and<IndexTerm>
  379. <Primary>Revert request</Primary>
  380. </IndexTerm>
  381. Revert requests.</Para></Entry>
  382. </Row>
  383. <Row>
  384. <Entry><Para><Filename><IndexTerm>
  385. <Primary>TTDT_SAVED</Primary>
  386. </IndexTerm>TTDT_SAVED,<IndexTerm>
  387. <Primary>TTDT_REVERTED</Primary>
  388. </IndexTerm>
  389. TTDT_REVERTED</Filename></Para></Entry>
  390. <Entry><Para>Unregisters handler patterns for Get_Modified, Save, and
  391. Revert requests.</Para><Para>If the <Command>send</Command> parameter is set, this function sends a<IndexTerm>
  392. <Primary>Saved notice</Primary>
  393. </IndexTerm>
  394. Saved or<IndexTerm>
  395. <Primary>Reverted notice</Primary>
  396. </IndexTerm>
  397. Reverted notice, respectively, in the scope.</Para></Entry>
  398. </Row>
  399. </TBody>
  400. </TGroup>
  401. </Table>
  402. <ItemizedList Remap="Bullet1">
  403. <ListItem>
  404. <Para>If the <Command>send</Command> parameter is set, this function sends the<IndexTerm>
  405. <Primary>Modified notice</Primary>
  406. </IndexTerm>
  407. Modified notice in the
  408. scope.</Para>
  409. </ListItem>
  410. <ListItem>
  411. <Para>If the <Command>context</Command> parameter is a value other than zero, messages created by
  412. this routine inherit all contexts whose slotname begins with<IndexTerm>
  413. <Primary>ENV_</Primary>
  414. </IndexTerm>
  415. <Filename>ENV_</Filename>.</Para>
  416. </ListItem>
  417. </ItemizedList>
  418. <Para><!--Original XRef content: 'Table&numsp;A&hyphen;4'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.4"> lists the possible errors that can be returned by this function.</Para>
  419. <Table Id="TTUG.MsgTk.tbl.6" Frame="Topbot">
  420. <Title Id="TTUG.MsgTk.mkr.4">Possible Errors Returned by ttdt_file_event</Title>
  421. <TGroup Cols="2">
  422. <ColSpec Colname="1" Colwidth="1.61706 in">
  423. <ColSpec Colname="2" Colwidth="3.41271 in">
  424. <THead>
  425. <Row>
  426. <Entry><Para><Literal>Error Returned</Literal></Para></Entry>
  427. <Entry><Para><Literal>Description</Literal></Para></Entry>
  428. </Row>
  429. </THead>
  430. <TBody>
  431. <Row>
  432. <Entry><Para><Filename><IndexTerm>
  433. <Primary>TT_DESKTOP_EINVAL</Primary>
  434. </IndexTerm><IndexTerm>
  435. <Primary>error messages</Primary>
  436. <Secondary>TT_DESKTOP_EINVAL</Secondary>
  437. </IndexTerm>TT_DESKTOP_EINVAL</Filename></Para></Entry>
  438. <Entry><Para>The event notice was invalid.
  439. Valid event notices are <Filename>TTDT_MODIFIED</Filename>, <Filename>TTD_TSAVED</Filename>,
  440. and <Filename>TTDT_REVERTED</Filename>.</Para></Entry>
  441. </Row>
  442. <Row>
  443. <Entry><Para><Filename><IndexTerm>
  444. <Primary>TT_ERR_POINTER</Primary>
  445. </IndexTerm><IndexTerm>
  446. <Primary>error messages</Primary>
  447. <Secondary>TT_ERR_POINTER</Secondary>
  448. </IndexTerm>TT_ERR_POINTER</Filename></Para></Entry>
  449. <Entry><Para>The <Command>patterns</Command> parameter was null.</Para></Entry>
  450. </Row>
  451. <Row>
  452. <Entry><Para><Filename><IndexTerm>
  453. <Primary>TT_ERR_OVERFLOW</Primary>
  454. </IndexTerm><IndexTerm>
  455. <Primary>error messages</Primary>
  456. <Secondary>TT_ERR_OVERFLOW</Secondary>
  457. </IndexTerm>TT_ERR_OVERFLOW</Filename></Para></Entry>
  458. <Entry><Para>The ToolTalk service has received the maximum amount
  459. of active messages (2000) it can properly handle.</Para></Entry>
  460. </Row>
  461. <Row>
  462. <Entry><Para><Filename><IndexTerm>
  463. <Primary>TT_ERR_NOMP</Primary>
  464. </IndexTerm><IndexTerm>
  465. <Primary>error messages</Primary>
  466. <Secondary>TT_ERR_NOMP</Secondary>
  467. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  468. <Entry><Para>The ttsession process is not available. The ToolTalk
  469. service tries to restart ttsession if it is not running. This
  470. error indicates that the ToolTalk service is either not
  471. installed or not installed correctly.</Para></Entry>
  472. </Row>
  473. </TBody>
  474. </TGroup>
  475. </Table>
  476. <Example Id="TTUG.MsgTk.tbl.7">
  477. <Title><IndexTerm>
  478. <Primary>ttdt_file_join</Primary>
  479. </IndexTerm><IndexTerm>
  480. <Primary>message sets</Primary>
  481. <Secondary>toolkit</Secondary>
  482. <Tertiary>ttdt_file_join</Tertiary>
  483. </IndexTerm><IndexTerm>
  484. <Primary>toolkit messages</Primary>
  485. <Secondary>ttdt_file_join</Secondary>
  486. </IndexTerm>ttdt_file_join</Title>
  487. <ProgramListing>Tt_message ( *Ttdt_file_cb) ( Tt_message msg,
  488. Tttk_op op,
  489. char * pathname,
  490. void * clientdata,
  491. int same_euid_egid,
  492. int same_procid );
  493. Tt_pattern * ttdt_file_join( const char * pathname,
  494. Tt_scope the_scope,
  495. int join,
  496. Ttdt_file_cb cb,
  497. void * clientdata );
  498. </ProgramListing>
  499. </Example>
  500. <Para>The <Filename>ttdt_file_join</Filename> function registers to observe ToolTalk events on the
  501. specified file. It registers in the scope to observe<IndexTerm>
  502. <Primary>Deleted notice</Primary>
  503. </IndexTerm>
  504. Deleted,<IndexTerm>
  505. <Primary>Modified notice</Primary>
  506. </IndexTerm>
  507. Modified,<IndexTerm>
  508. <Primary>Reverted notice</Primary>
  509. </IndexTerm>
  510. Reverted,<IndexTerm>
  511. <Primary>Moved notice</Primary>
  512. </IndexTerm>
  513. Moved, and<IndexTerm>
  514. <Primary>Saved notice</Primary>
  515. </IndexTerm>
  516. Saved notices.</Para>
  517. <ItemizedList Remap="Bullet1">
  518. <ListItem>
  519. <Para>The callback message argument<IndexTerm>
  520. <Primary>Ttdt_file_cb</Primary>
  521. </IndexTerm>
  522. <Filename>Ttdt_file_cb</Filename> takes the parameters listed
  523. in
  524. <!--Original XRef content: 'Table&numsp;A&hyphen;5'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.5">.</Para>
  525. </ListItem>
  526. </ItemizedList>
  527. <Table Id="TTUG.MsgTk.tbl.8" Frame="Topbot">
  528. <Title Id="TTUG.MsgTk.mkr.5">Parameters taken by Ttdt_file_cb</Title>
  529. <TGroup Cols="2">
  530. <ColSpec Colname="1" Colwidth="1.25 in">
  531. <ColSpec Colname="2" Colwidth="3.73148 in">
  532. <THead>
  533. <Row>
  534. <Entry><Para><Literal>Parameter</Literal></Para></Entry>
  535. <Entry><Para><Literal>Description</Literal></Para></Entry>
  536. </Row>
  537. </THead>
  538. <TBody>
  539. <Row>
  540. <Entry><Para><Command>message</Command></Para></Entry>
  541. <Entry><Para>The message being sent.</Para></Entry>
  542. </Row>
  543. <Row>
  544. <Entry><Para><Command>op</Command></Para></Entry>
  545. <Entry><Para>The operation being requested.</Para></Entry>
  546. </Row>
  547. <Row>
  548. <Entry><Para><Command>pathname</Command></Para></Entry>
  549. <Entry><Para>The path name of the file to which the message pertains. This
  550. copy can be freed with the ToolTalk function<IndexTerm>
  551. <Primary>tt_free</Primary>
  552. </IndexTerm><IndexTerm>
  553. <Primary>ToolTalk functions</Primary>
  554. <Secondary>tt_free</Secondary>
  555. </IndexTerm>
  556. <Filename>tt_free</Filename>.</Para></Entry>
  557. </Row>
  558. <Row>
  559. <Entry><Para><Command>clientdata</Command></Para></Entry>
  560. <Entry><Para>The client data contained in the message.</Para></Entry>
  561. </Row>
  562. <Row>
  563. <Entry><Para><Filename>same_euid_egid</Filename></Para></Entry>
  564. <Entry><Para>A flag that identifies the sender; if this value is true, the sender
  565. can be trusted.</Para></Entry>
  566. </Row>
  567. <Row>
  568. <Entry><Para><Filename>same_procid</Filename></Para></Entry>
  569. <Entry><Para>A flag that identifies the sender; if this value is true, the sender
  570. is the same procid as the receiver.</Para></Entry>
  571. </Row>
  572. </TBody>
  573. </TGroup>
  574. </Table>
  575. <ItemizedList Remap="Bullet1">
  576. <ListItem>
  577. <Para>If the value of <Filename>the_scope</Filename> parameter is zero (that is,<IndexTerm>
  578. <Primary>TT_SCOPE_NONE</Primary>
  579. </IndexTerm>
  580. <Filename>TT_SCOPE_NONE</Filename>), the
  581. file scope is set to the default (<IndexTerm>
  582. <Primary>TT_BOTH</Primary>
  583. </IndexTerm>
  584. <Filename>TT_BOTH</Filename>); however, if, for example, the
  585. ToolTalk database server <Filename>rpc.ttdbserver</Filename> is not installed on the file server
  586. that owns <Command>pathname</Command>, the file scope is set to<IndexTerm>
  587. <Primary>TT_FILE_IN_SESSION</Primary>
  588. </IndexTerm>
  589. <Filename>TT_FILE_IN_SESSION</Filename>.</Para>
  590. <Para>The <Filename>ttdt_file_join</Filename> function associates the value of <Filename>the_scope</Filename> and a
  591. copy of <Command>pathname</Command> with the <Filename>Tt_patterns</Filename> returned to allow the
  592. <Filename>ttdt_file_quit</Filename> function to access the patterns. The caller can modify or
  593. free <Command>pathname</Command> after the <Filename>ttdt_file_join</Filename> call returns.</Para>
  594. </ListItem>
  595. <ListItem>
  596. <Para>If the value of the <Command>join</Command> parameter is true, this function calls</Para>
  597. </ListItem>
  598. </ItemizedList>
  599. <programlisting><IndexTerm><Primary>tt_file_join( pathname )</Primary></IndexTerm>tt_file_join( pathname )</ProgramListing>
  600. <Para>This function returns a null-terminated array of <Filename>Tt_pattern</Filename>. Use the<IndexTerm>
  601. <Primary>ttdt_file_quit</Primary>
  602. </IndexTerm><IndexTerm>
  603. <Primary>message sets</Primary>
  604. <Secondary>toolkit</Secondary>
  605. <Tertiary>ttdt_file_quit</Tertiary>
  606. </IndexTerm><IndexTerm>
  607. <Primary>toolkit messages</Primary>
  608. <Secondary>ttdt_file_quit</Secondary>
  609. </IndexTerm>
  610. <Filename>ttdt_file_quit</Filename> function to destroy the array. If an error is returned, the
  611. returned array is an error pointer that can be decoded with<IndexTerm>
  612. <Primary>tt_ptr_error</Primary>
  613. </IndexTerm>
  614. <Filename>tt_ptr_error</Filename>.
  615. <!--Original XRef content: 'Table&numsp;A&hyphen;6'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.6"> is a list of the possible errors returned by the <Filename>ttdt_file_join</Filename>
  616. function.</Para>
  617. <Table Id="TTUG.MsgTk.tbl.9" Frame="Topbot">
  618. <Title Id="TTUG.MsgTk.mkr.6">Possible Errors Returned by ttdt_file_join</Title>
  619. <TGroup Cols="2">
  620. <ColSpec Colname="1" Colwidth="1.25 in">
  621. <ColSpec Colname="2" Colwidth="3.74074 in">
  622. <THead>
  623. <Row>
  624. <Entry><Para><Literal>Error Returned</Literal></Para></Entry>
  625. <Entry><Para><Literal>Description</Literal></Para></Entry>
  626. </Row>
  627. </THead>
  628. <TBody>
  629. <Row>
  630. <Entry><Para><Filename><IndexTerm>
  631. <Primary>TT_ERR_NOMP</Primary>
  632. </IndexTerm><IndexTerm>
  633. <Primary>error messages</Primary>
  634. <Secondary>TT_ERR_NOMP</Secondary>
  635. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  636. <Entry><Para>The ttsession process is not available. The ToolTalk service tries
  637. to restart ttsession if it is not running. This error indicates that
  638. the ToolTalk service is either not installed or not installed
  639. correctly.</Para></Entry>
  640. </Row>
  641. <Row>
  642. <Entry><Para><Filename><IndexTerm>
  643. <Primary>TT_ERR_DBAVAIL</Primary>
  644. </IndexTerm><IndexTerm>
  645. <Primary>error messages</Primary>
  646. <Secondary>TT_ERR_DBAVAIL</Secondary>
  647. </IndexTerm>TT_ERR_DBAVAIL</Filename></Para></Entry>
  648. <Entry><Para>The ToolTalk service could not access the ToolTalk database
  649. needed for this operation.</Para></Entry>
  650. </Row>
  651. <Row>
  652. <Entry><Para><Filename><IndexTerm>
  653. <Primary>TT_ERR_DBEXIST</Primary>
  654. </IndexTerm><IndexTerm>
  655. <Primary>error messages</Primary>
  656. <Secondary>TT_ERR_DBEXIST</Secondary>
  657. </IndexTerm>TT_ERR_DBEXIST</Filename></Para></Entry>
  658. <Entry><Para>The ToolTalk service did not find the specified ToolTalk
  659. database in the expected place.</Para></Entry>
  660. </Row>
  661. <Row>
  662. <Entry><Para><Filename><IndexTerm>
  663. <Primary>TT_ERR_PATH</Primary>
  664. </IndexTerm><IndexTerm>
  665. <Primary>error messages</Primary>
  666. <Secondary>TT_ERR_PATH</Secondary>
  667. </IndexTerm>TT_ERR_PATH</Filename></Para></Entry>
  668. <Entry><Para>The ToolTalk service was not able to read a directory in the
  669. specified file path name.</Para></Entry>
  670. </Row>
  671. <Row>
  672. <Entry><Para><Filename><IndexTerm>
  673. <Primary>TT_ERR_NOMEM</Primary>
  674. </IndexTerm><IndexTerm>
  675. <Primary>error messages</Primary>
  676. <Secondary>TT_ERR_NOMEM</Secondary>
  677. </IndexTerm>TT_ERR_NOMEM</Filename></Para></Entry>
  678. <Entry><Para>There is not enough memory available to perform the
  679. operation.</Para></Entry>
  680. </Row>
  681. </TBody>
  682. </TGroup>
  683. </Table>
  684. <Example Id="TTUG.MsgTk.tbl.10">
  685. <Title><IndexTerm>
  686. <Primary>ttdt_file_notice</Primary>
  687. </IndexTerm><IndexTerm>
  688. <Primary>message sets</Primary>
  689. <Secondary>toolkit</Secondary>
  690. <Tertiary>ttdt_file_notice</Tertiary>
  691. </IndexTerm><IndexTerm>
  692. <Primary>toolkit messages</Primary>
  693. <Secondary>ttdt_file_notice</Secondary>
  694. </IndexTerm>ttdt_file_notice</Title>
  695. <ProgramListing>Tt_message ttdt_file_notice( Tt_message context,
  696. Tttk_op op,
  697. Tt_scope scope,
  698. const char * pathname,
  699. int send_and_destroy );
  700. </ProgramListing>
  701. </Example>
  702. <Para>The <Filename>ttdt_file_notice</Filename> function creates and, optionally, sends a standard
  703. ToolTalk notice about a file. Use this function to create the following standard
  704. file notices:<IndexTerm>
  705. <Primary>Created notice</Primary>
  706. </IndexTerm>
  707. Created,<IndexTerm>
  708. <Primary>Deleted notice</Primary>
  709. </IndexTerm>
  710. Deleted,<IndexTerm>
  711. <Primary>Moved notice</Primary>
  712. </IndexTerm>
  713. Moved,<IndexTerm>
  714. <Primary>Reverted notice</Primary>
  715. </IndexTerm>
  716. Reverted,<IndexTerm>
  717. <Primary>Saved notice</Primary>
  718. </IndexTerm>
  719. Saved, and<IndexTerm>
  720. <Primary>Modified notice</Primary>
  721. </IndexTerm>
  722. Modified.</Para>
  723. <Note>
  724. <Para>The<IndexTerm>
  725. <Primary>ttdt_file_event</Primary>
  726. </IndexTerm><IndexTerm>
  727. <Primary>message sets</Primary>
  728. <Secondary>toolkit</Secondary>
  729. <Tertiary>ttdt_file_event</Tertiary>
  730. </IndexTerm><IndexTerm>
  731. <Primary>toolkit messages</Primary>
  732. <Secondary>ttdt_file_event</Secondary>
  733. </IndexTerm>
  734. <Filename>ttdt_file_event</Filename> function is a higher-level interface than the
  735. <Filename>ttdt_file_notice</Filename> function and is the preferred method to send all notices
  736. except the Moved notice.</Para>
  737. </Note>
  738. <ItemizedList Remap="Bullet1">
  739. <ListItem>
  740. <Para>If the <Command>context</Command> parameter is a value other than zero, messages created by
  741. this routine inherit all contexts whose slotname begins with <Filename>ENV_</Filename>.</Para>
  742. </ListItem>
  743. <ListItem>
  744. <Para>This function creates a notice with the specified <Symbol Role="Variable">op</Symbol> and <Emphasis>scope</Emphasis> parameters,
  745. and sets its file attribute to <Command>pathname</Command> parameter.</Para>
  746. </ListItem>
  747. <ListItem>
  748. <Para>If the <Filename>send_and_destroy</Filename> parameter is set, this function sends the message
  749. and then destroys it.</Para>
  750. <Para>If the value of the <Filename>send_and_destroy</Filename> parameter is false, the created
  751. message is returned; if the value of the <Filename>send_and_destroy</Filename> parameter is
  752. true, zero is returned.</Para>
  753. </ListItem>
  754. </ItemizedList>
  755. <Para>If an error occurs, an error pointer is returned. Use <Filename>tt_ptr_error</Filename> to find out
  756. the <Filename>Tt_status</Filename>.
  757. <!--Original XRef content: 'Table&numsp;A&hyphen;7'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.7"> describes possible errors returned by this function.</Para>
  758. <Table Id="TTUG.MsgTk.tbl.11" Frame="Topbot">
  759. <Title Id="TTUG.MsgTk.mkr.7">Possible Errors Returned by ttdt_file_notice</Title>
  760. <TGroup Cols="2">
  761. <ColSpec Colname="1" Colwidth="1.55754 in">
  762. <ColSpec Colname="2" Colwidth="3.42263 in">
  763. <THead>
  764. <Row>
  765. <Entry><Para><Literal>Error Returned</Literal></Para></Entry>
  766. <Entry><Para><Literal>Description</Literal></Para></Entry>
  767. </Row>
  768. </THead>
  769. <TBody>
  770. <Row>
  771. <Entry><Para><Filename><IndexTerm>
  772. <Primary>TT_ERR_NOMP</Primary>
  773. </IndexTerm><IndexTerm>
  774. <Primary>error messages</Primary>
  775. <Secondary>TT_ERR_NOMP</Secondary>
  776. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  777. <Entry><Para>The ttsession process is not available. The ToolTalk
  778. service tries to restart ttsession if it is not running. This
  779. error indicates that the ToolTalk service is either not
  780. installed or not installed correctly.</Para></Entry>
  781. </Row>
  782. <Row>
  783. <Entry><Para><Filename><IndexTerm>
  784. <Primary>TT_ERR_PROCID</Primary>
  785. </IndexTerm><IndexTerm>
  786. <Primary>error messages</Primary>
  787. <Secondary>TT_ERR_PROCID</Secondary>
  788. </IndexTerm>TT_ERR_PROCID</Filename></Para></Entry>
  789. <Entry><Para>The process identifier specified is out of date or invalid.</Para></Entry>
  790. </Row>
  791. <Row>
  792. <Entry><Para><Filename><IndexTerm>
  793. <Primary>TT_ERR_NOMEM</Primary>
  794. </IndexTerm><IndexTerm>
  795. <Primary>error messages</Primary>
  796. <Secondary>TT_ERR_NOMEM</Secondary>
  797. </IndexTerm>TT_ERR_NOMEM</Filename></Para></Entry>
  798. <Entry><Para>There is not enough memory available to perform the
  799. operation.</Para></Entry>
  800. </Row>
  801. <Row>
  802. <Entry><Para><Filename><IndexTerm>
  803. <Primary>TT_ERR_OVERFLOW</Primary>
  804. </IndexTerm><IndexTerm>
  805. <Primary>error messages</Primary>
  806. <Secondary>TT_ERR_OVERFLOW</Secondary>
  807. </IndexTerm>TT_ERR_OVERFLOW</Filename></Para></Entry>
  808. <Entry><Para>The ToolTalk service has received the maximum amount
  809. of active messages (2000) it can properly handle.</Para></Entry>
  810. </Row>
  811. <Row>
  812. <Entry><Para><Filename><IndexTerm>
  813. <Primary>TT_ERR_DBAVAIL</Primary>
  814. </IndexTerm><IndexTerm>
  815. <Primary>error messages</Primary>
  816. <Secondary>TT_ERR_DBAVAIL</Secondary>
  817. </IndexTerm>TT_ERR_DBAVAIL</Filename></Para></Entry>
  818. <Entry><Para>The ToolTalk service could not access the ToolTalk
  819. database needed for this operation.</Para></Entry>
  820. </Row>
  821. <Row>
  822. <Entry><Para><Filename><IndexTerm>
  823. <Primary>TT_ERR_DBEXIST</Primary>
  824. </IndexTerm><IndexTerm>
  825. <Primary>error messages</Primary>
  826. <Secondary>TT_ERR_DBEXIST</Secondary>
  827. </IndexTerm>TT_ERR_DBEXIST</Filename></Para></Entry>
  828. <Entry><Para>The ToolTalk service did not find the specified ToolTalk
  829. database in the expected place.</Para></Entry>
  830. </Row>
  831. <Row>
  832. <Entry><Para><Filename><IndexTerm>
  833. <Primary>TT_DESKTOP_EINVAL</Primary>
  834. </IndexTerm><IndexTerm>
  835. <Primary>error messages</Primary>
  836. <Secondary>TT_DESKTOP_EINVAL</Secondary>
  837. </IndexTerm>TT_DESKTOP_EINVAL</Filename></Para></Entry>
  838. <Entry><Para>The operation was moved, and the value of the
  839. <Filename>send_and_destroy</Filename> parameter was true.</Para></Entry>
  840. </Row>
  841. <Row>
  842. <Entry><Para><Filename><IndexTerm>
  843. <Primary>TT_ERR_POINTER</Primary>
  844. </IndexTerm><IndexTerm>
  845. <Primary>error messages</Primary>
  846. <Secondary>TT_ERR_POINTER</Secondary>
  847. </IndexTerm>TT_ERR_POINTER</Filename></Para></Entry>
  848. <Entry><Para>The path name was null, or was a ToolTalk error pointer.</Para></Entry>
  849. </Row>
  850. </TBody>
  851. </TGroup>
  852. </Table>
  853. <Example Id="TTUG.MsgTk.tbl.12">
  854. <Title><IndexTerm>
  855. <Primary>ttdt_file_quit</Primary>
  856. </IndexTerm><IndexTerm>
  857. <Primary>message sets</Primary>
  858. <Secondary>toolkit</Secondary>
  859. <Tertiary>ttdt_file_quit</Tertiary>
  860. </IndexTerm><IndexTerm>
  861. <Primary>toolkit messages</Primary>
  862. <Secondary>ttdt_file_quit</Secondary>
  863. </IndexTerm>ttdt_file_quit</Title>
  864. <ProgramListing>Tt_status ttdt_file_quit( Tt_pattern * patterns,
  865. int quit );
  866. </ProgramListing>
  867. </Example>
  868. <Para>The <Filename>ttdt_file_quit</Filename> function unregisters interest in ToolTalk events about a
  869. file. This function destroys patterns. If the <Command>quit</Command> parameter is set, this function
  870. calls</Para>
  871. <programlisting><IndexTerm><Primary>tt_file_quit( pathname )</Primary></IndexTerm>tt_file_quit( pathname )</ProgramListing>
  872. <Para>Use this function to unregister interest in the path name that was passed to the<IndexTerm>
  873. <Primary>ttdt_file_join</Primary>
  874. </IndexTerm><IndexTerm>
  875. <Primary>message sets</Primary>
  876. <Secondary>toolkit</Secondary>
  877. <Tertiary>ttdt_file_join</Tertiary>
  878. </IndexTerm><IndexTerm>
  879. <Primary>toolkit messages</Primary>
  880. <Secondary>ttdt_file_join</Secondary>
  881. </IndexTerm>
  882. <Filename>ttdt_file_join</Filename> function when <Emphasis>patterns</Emphasis> was created.
  883. <!--Original XRef content: 'Table&numsp;A&hyphen;8'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.9"> lists the
  884. possible errors returned by this function.</Para>
  885. <Table Id="TTUG.MsgTk.tbl.13" Frame="Topbot">
  886. <Title Id="TTUG.MsgTk.mkr.8">Possible Errors Returned by ttdt_file_quit</Title>
  887. <TGroup Cols="2">
  888. <ColSpec Colname="1" Colwidth="1.25 in">
  889. <ColSpec Colname="2" Colwidth="3.73017 in">
  890. <THead>
  891. <Row>
  892. <Entry><Para><Literal>Error Returned</Literal></Para></Entry>
  893. <Entry><Para><Literal>Description</Literal></Para></Entry>
  894. </Row>
  895. </THead>
  896. <TBody>
  897. <Row>
  898. <Entry><Para><Filename><IndexTerm>
  899. <Primary>TT_ERR_NOMP</Primary>
  900. </IndexTerm><IndexTerm>
  901. <Primary>error messages</Primary>
  902. <Secondary>TT_ERR_NOMP</Secondary>
  903. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  904. <Entry><Para>The ttsession process is not available. The ToolTalk service tries
  905. to restart ttsession if it is not running. This error indicates that
  906. the ToolTalk service is either not installed or not installed
  907. correctly.</Para></Entry>
  908. </Row>
  909. <Row>
  910. <Entry><Para><Filename><IndexTerm>
  911. <Primary>TT_ERR_PROCID</Primary>
  912. </IndexTerm><IndexTerm>
  913. <Primary>error messages</Primary>
  914. <Secondary>TT_ERR_PROCID</Secondary>
  915. </IndexTerm>TT_ERR_PROCID</Filename></Para></Entry>
  916. <Entry><Para>The process identifier specified is out of date or invalid.</Para></Entry>
  917. </Row>
  918. <Row>
  919. <Entry><Para><Filename><IndexTerm>
  920. <Primary>TT_ERR_DBAVAIL</Primary>
  921. </IndexTerm><IndexTerm>
  922. <Primary>error messages</Primary>
  923. <Secondary>TT_ERR_DBAVAIL</Secondary>
  924. </IndexTerm>TT_ERR_DBAVAIL</Filename></Para></Entry>
  925. <Entry><Para>The ToolTalk service could not access the ToolTalk database
  926. needed for this operation.</Para></Entry>
  927. </Row>
  928. <Row>
  929. <Entry><Para><Filename><IndexTerm>
  930. <Primary>TT_ERR_DBEXIST</Primary>
  931. </IndexTerm><IndexTerm>
  932. <Primary>error messages</Primary>
  933. <Secondary>TT_ERR_DBEXIST</Secondary>
  934. </IndexTerm>TT_ERR_DBEXIST</Filename></Para></Entry>
  935. <Entry><Para>The ToolTalk service did not find the specified ToolTalk
  936. database in the expected place.</Para></Entry>
  937. </Row>
  938. <Row>
  939. <Entry><Para><Command><IndexTerm>
  940. <Primary>TT_ERR_POINTER</Primary>
  941. </IndexTerm><IndexTerm>
  942. <Primary>error messages</Primary>
  943. <Secondary>TT_ERR_POINTER</Secondary>
  944. </IndexTerm>TT_ERR_POINTER</Command></Para></Entry>
  945. <Entry><Para>The patterns were null or otherwise invalid.</Para></Entry>
  946. </Row>
  947. </TBody>
  948. </TGroup>
  949. </Table>
  950. <Example Id="TTUG.MsgTk.tbl.14">
  951. <Title><IndexTerm>
  952. <Primary>ttdt_file_request</Primary>
  953. </IndexTerm><IndexTerm>
  954. <Primary>message sets</Primary>
  955. <Secondary>toolkit</Secondary>
  956. <Tertiary>ttdt_file_request</Tertiary>
  957. </IndexTerm><IndexTerm>
  958. <Primary>toolkit messages</Primary>
  959. <Secondary>ttdt_file_request</Secondary>
  960. </IndexTerm>ttdt_file_request</Title>
  961. <ProgramListing>Tt_message ttdt_file_request( Tt_message context,
  962. Tttk_op op,
  963. Tt_scope scope,
  964. const char pathname,
  965. Ttdt_file_cb cb,
  966. void client_data,
  967. int send_and_destroy );
  968. </ProgramListing>
  969. </Example>
  970. <Para>The <Filename>ttdt_file_request</Filename> function creates, and optionally sends, any
  971. standard Desktop file&hyphen;scoped request (such as Get_Modified, Save, and
  972. Revert).</Para>
  973. <Note>
  974. <Para>This function is a lower-level interface than the
  975. <Filename>ttdt_Get_Modified</Filename>,<IndexTerm>
  976. <Primary>tdt_Get_Modified</Primary>
  977. </IndexTerm>
  978. <Filename>ttdt_Save</Filename>,<IndexTerm>
  979. <Primary>ttdt_Save</Primary>
  980. </IndexTerm>
  981. and <Filename>ttdt_Revert</Filename><IndexTerm>
  982. <Primary>ttdt_Revert</Primary>
  983. </IndexTerm>
  984. functions, which create and send the request
  985. and then block on its reply.</Para>
  986. </Note>
  987. <Para>The <Filename>ttdt_file_request</Filename> function creates a request with the specified <Symbol Role="Variable">op</Symbol> and
  988. <Symbol Role="Variable">scope</Symbol>, and sets its file attribute to <Symbol Role="Variable">pathname</Symbol>. Per Desktop messaging
  989. conventions, an unset Tt_mode argument of <Filename>TT_IN</Filename> and the vtype <Command>File</Command> is
  990. added to the request; and if the specified operation is<IndexTerm>
  991. <Primary>TTDT_GET_MODIFIED</Primary>
  992. </IndexTerm>
  993. <Filename>TTDT_GET_MODIFIED</Filename>,
  994. an unset Tt_mode argument of <Filename>TT_OUT</Filename> and the vtype <Command>Boolean</Command> is also added
  995. to the request.</Para>
  996. <Para>If <Symbol Role="Variable">context</Symbol> is not zero, the request created by this routine inherits from
  997. <Symbol Role="Variable">context</Symbol> all contexts whose slotname are prefixed with <Filename>ENV_</Filename>.</Para>
  998. <Para>This function installs <Emphasis>cb</Emphasis> as a message callback for the created request, and
  999. ensures that client data will be passed into the callback. If <Emphasis>send</Emphasis> is true, this
  1000. function sends the request before returning the handle to it.</Para>
  1001. <Para>This function returns the created Tt_message when successful. If an error
  1002. occurs, an error pointer is returned. Use <Filename>tt_ptr_error</Filename> to find out the
  1003. Tt_status.
  1004. <!--Original XRef content: 'Table&numsp;A&hyphen;8'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.8"> lists the possible errors returned by this function.</Para>
  1005. <Table Id="TTUG.MsgTk.tbl.15" Frame="Topbot">
  1006. <Title Id="TTUG.MsgTk.mkr.9">Possible Errors Returned by ttdt_file_request</Title>
  1007. <TGroup Cols="2">
  1008. <ColSpec Colname="1" Colwidth="1.40046 in">
  1009. <ColSpec Colname="2" Colwidth="3.55656 in">
  1010. <THead>
  1011. <Row>
  1012. <Entry><Para><Literal>Error Returned</Literal></Para></Entry>
  1013. <Entry><Para><Literal>Description</Literal></Para></Entry>
  1014. </Row>
  1015. </THead>
  1016. <TBody>
  1017. <Row>
  1018. <Entry><Para><Filename><IndexTerm>
  1019. <Primary>TT_ERR_NOMP</Primary>
  1020. </IndexTerm><IndexTerm>
  1021. <Primary>error messages</Primary>
  1022. <Secondary>TT_ERR_NOMP</Secondary>
  1023. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  1024. <Entry><Para>The ttsession process is not available. The ToolTalk service
  1025. tries to restart ttsession if it is not running. This error
  1026. indicates that the ToolTalk service is either not installed or
  1027. not installed correctly.</Para></Entry>
  1028. </Row>
  1029. <Row>
  1030. <Entry><Para><Filename><IndexTerm>
  1031. <Primary>TT_ERR_PROCID</Primary>
  1032. </IndexTerm><IndexTerm>
  1033. <Primary>error messages</Primary>
  1034. <Secondary>TT_ERR_PROCID</Secondary>
  1035. </IndexTerm>TT_ERR_PROCID</Filename></Para></Entry>
  1036. <Entry><Para>The process identifier specified is out of date or invalid.</Para></Entry>
  1037. </Row>
  1038. <Row>
  1039. <Entry><Para><Filename><IndexTerm>
  1040. <Primary>TT_ERR_NOMEM</Primary>
  1041. </IndexTerm><IndexTerm>
  1042. <Primary>error messages</Primary>
  1043. <Secondary>TT_ERR_NOMEM</Secondary>
  1044. </IndexTerm>TT_ERR_NOMEM</Filename></Para></Entry>
  1045. <Entry><Para>There is not enough available memory to perform the
  1046. operation.</Para></Entry>
  1047. </Row>
  1048. <Row>
  1049. <Entry><Para><Filename><IndexTerm>
  1050. <Primary>TT_ERR_OVERFLOW</Primary>
  1051. </IndexTerm><IndexTerm>
  1052. <Primary>error messages</Primary>
  1053. <Secondary>TT_ERR_OVERFLOW</Secondary>
  1054. </IndexTerm>TT_ERR_OVERFLOW</Filename></Para></Entry>
  1055. <Entry><Para>The ToolTalk service has received the maximum amount of
  1056. active messages (2000) it can properly handle.</Para></Entry>
  1057. </Row>
  1058. <Row>
  1059. <Entry><Para><Filename><IndexTerm>
  1060. <Primary>TT_ERR_DBAVAIL</Primary>
  1061. </IndexTerm><IndexTerm>
  1062. <Primary>error messages</Primary>
  1063. <Secondary>TT_ERR_DBAVAIL</Secondary>
  1064. </IndexTerm>TT_ERR_DBAVAIL</Filename></Para></Entry>
  1065. <Entry><Para>The ToolTalk service could not access the ToolTalk database
  1066. needed for this operation.</Para></Entry>
  1067. </Row>
  1068. <Row>
  1069. <Entry><Para><Filename><IndexTerm>
  1070. <Primary>TT_ERR_DBEXIST</Primary>
  1071. </IndexTerm><IndexTerm>
  1072. <Primary>error messages</Primary>
  1073. <Secondary>TT_ERR_DBEXIST</Secondary>
  1074. </IndexTerm>TT_ERR_DBEXIST</Filename></Para></Entry>
  1075. <Entry><Para>The ToolTalk service did not find the specified ToolTalk
  1076. database in the expected place.</Para></Entry>
  1077. </Row>
  1078. <Row>
  1079. <Entry><Para><Command><IndexTerm>
  1080. <Primary>TT_ERR_POINTER</Primary>
  1081. </IndexTerm><IndexTerm>
  1082. <Primary>error messages</Primary>
  1083. <Secondary>TT_ERR_POINTER</Secondary>
  1084. </IndexTerm>TT_ERR_POINTER</Command></Para></Entry>
  1085. <Entry><Para>The path name was null or otherwise invalid.</Para></Entry>
  1086. </Row>
  1087. </TBody>
  1088. </TGroup>
  1089. </Table>
  1090. <Example Id="TTUG.MsgTk.tbl.16">
  1091. <Title><IndexTerm>
  1092. <Primary>ttdt_Get_Modified</Primary>
  1093. </IndexTerm><IndexTerm>
  1094. <Primary>message sets</Primary>
  1095. <Secondary>toolkit</Secondary>
  1096. <Tertiary>ttdt_Get_Modified</Tertiary>
  1097. </IndexTerm><IndexTerm>
  1098. <Primary>toolkit messages</Primary>
  1099. <Secondary>ttdt_Get_Modified</Secondary>
  1100. </IndexTerm>ttdt_Get_Modified</Title>
  1101. <ProgramListing>int ttdt_Get_Modified( Tt_message context,
  1102. const char * pathname,
  1103. Tt_scope the_scope,
  1104. XtAppContext app2run,
  1105. int ms_timeout );
  1106. </ProgramListing>
  1107. </Example>
  1108. <Para>The <Filename>ttdt_Get_Modified</Filename> function asks if any ToolTalk client has changes
  1109. pending on a file. This function sends a<IndexTerm>
  1110. <Primary>Get_Modified request</Primary>
  1111. </IndexTerm>
  1112. Get_Modified request and waits for a
  1113. reply.</Para>
  1114. <ItemizedList Remap="Bullet1">
  1115. <ListItem>
  1116. <Para>If the <Symbol Role="Variable">context</Symbol> parameter is a value other than zero, messages created by
  1117. this routine inherit all contexts whose slotname begins with <Filename>ENV_</Filename>.</Para>
  1118. </ListItem>
  1119. <ListItem>
  1120. <Para>The Get_Modified request asks if any ToolTalk client has changes pending
  1121. on <Symbol Role="Variable">pathname</Symbol> that it intends to make persistent.</Para>
  1122. </ListItem>
  1123. <ListItem>
  1124. <Para>The <Emphasis>the_scope</Emphasis> parameter indicates the scope in which the Get_Modified
  1125. request is sent. If the value of this parameter is zero (that is,<IndexTerm>
  1126. <Primary>TT_SCOPE_NONE</Primary>
  1127. </IndexTerm>
  1128. <Filename>TT_SCOPE_NONE</Filename>), the file scope is set to the default (<IndexTerm>
  1129. <Primary>TT_BOTH</Primary>
  1130. </IndexTerm><Filename>TT_BOTH</Filename>); however, if,
  1131. for example, the ToolTalk database server <Filename>rpc.ttdbserver</Filename> is not installed
  1132. on the file server that owns <Symbol Role="Variable">pathname</Symbol>, the file scope is set to<IndexTerm>
  1133. <Primary>TT_FILE_IN_SESSION</Primary>
  1134. </IndexTerm>
  1135. <Filename>TT_FILE_IN_SESSION</Filename>.</Para>
  1136. </ListItem>
  1137. <ListItem>
  1138. <Para>The <Emphasis>app2run</Emphasis> and <Emphasis>ms_timeout</Emphasis> parameters are passed to the<IndexTerm>
  1139. <Primary>tttk_block_while</Primary>
  1140. </IndexTerm><IndexTerm>
  1141. <Primary>message sets</Primary>
  1142. <Secondary>toolkit</Secondary>
  1143. <Tertiary>tttk_block_while</Tertiary>
  1144. </IndexTerm><IndexTerm>
  1145. <Primary>toolkit messages</Primary>
  1146. <Secondary>tttk_block_while</Secondary>
  1147. </IndexTerm>
  1148. <Filename>tttk_block_while</Filename> function to block on the reply to the Get_Modified
  1149. request sent by this function.</Para>
  1150. </ListItem>
  1151. </ItemizedList>
  1152. <Para>If the Get_Modified request receives an affirmative reply within the specified
  1153. time out, the <Filename>ttdt_Get_Modified</Filename> function returns non-zero; otherwise, it
  1154. returns zero. This call does not return any errors.</Para>
  1155. <Example Id="TTUG.MsgTk.tbl.17">
  1156. <Title><IndexTerm>
  1157. <Primary>ttdt_message_accept</Primary>
  1158. </IndexTerm><IndexTerm>
  1159. <Primary>message sets</Primary>
  1160. <Secondary>toolkit</Secondary>
  1161. </IndexTerm><IndexTerm>
  1162. <Primary>ttdt_message_receive</Primary>
  1163. </IndexTerm><IndexTerm>
  1164. <Primary>toolkit messages</Primary>
  1165. <Secondary>ttdt_message_accept</Secondary>
  1166. </IndexTerm>ttdt_message_accept</Title>
  1167. <ProgramListing>Tt_pattern * ttdt_message_accept( Tt_message contract,
  1168. Ttdt_contract_cb cb,
  1169. void * clientdata,
  1170. Widget shell,
  1171. int accept,
  1172. int sendStatus );
  1173. </ProgramListing>
  1174. </Example>
  1175. <Para>The <Filename>ttdt_message_accept</Filename> function accepts a contract to handle a ToolTalk
  1176. request. A tool calls this function when it wants to accept responsibility for
  1177. handling (that is, failing or rejecting) a request.</Para>
  1178. <Para>A<IndexTerm>
  1179. <Primary>Ttdt_contract_cb argument</Primary>
  1180. </IndexTerm>
  1181. <StructName Role="typedef">Ttdt_contract_cb</StructName> argument takes the parameters listed in
  1182. <!--Original XRef content: 'Table&numsp;A&hyphen;10'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.10">.</Para>
  1183. <Table Id="TTUG.MsgTk.tbl.18" Frame="Topbot">
  1184. <Title Id="TTUG.MsgTk.mkr.10">Parameters Taken by the Ttdt_contract_cb Argument</Title>
  1185. <TGroup Cols="2">
  1186. <ColSpec Colname="1" Colwidth="1.61707 in">
  1187. <ColSpec Colname="2" Colwidth="3.37302 in">
  1188. <THead>
  1189. <Row>
  1190. <Entry><Para><Literal>Parameter</Literal></Para></Entry>
  1191. <Entry><Para><Literal>Description</Literal></Para></Entry>
  1192. </Row>
  1193. </THead>
  1194. <TBody>
  1195. <Row>
  1196. <Entry><Para><Command>Tt_message msg</Command></Para></Entry>
  1197. <Entry><Para>The request in the sent state.
  1198. The client program must either fail, reject, or reply to
  1199. the message.</Para></Entry>
  1200. </Row>
  1201. <Row>
  1202. <Entry><Para><Command>Tttk_op op</Command></Para></Entry>
  1203. <Entry><Para>The operation of the incoming request.</Para></Entry>
  1204. </Row>
  1205. <Row>
  1206. <Entry><Para><Command>Widget shell</Command></Para></Entry>
  1207. <Entry><Para>The shell passed to the <Filename>ttdt_message_accept</Filename>
  1208. function.</Para></Entry>
  1209. </Row>
  1210. <Row>
  1211. <Entry><Para><Command>void *clientdata</Command></Para></Entry>
  1212. <Entry><Para>The client data passed to the <Filename>ttdt_message_accept</Filename>
  1213. function.</Para></Entry>
  1214. </Row>
  1215. <Row>
  1216. <Entry><Para><Command>Tt_message contract</Command></Para></Entry>
  1217. <Entry><Para>The contract passed to the <Filename>ttdt_message_accept</Filename>
  1218. function.</Para></Entry>
  1219. </Row>
  1220. </TBody>
  1221. </TGroup>
  1222. </Table>
  1223. <Para>If the callback processes the message <Emphasis>msg</Emphasis> successfully, it returns zero;
  1224. otherwise, it returns a <Filename>tt_error_pointer</Filename> cast to <Filename>Tt_message</Filename>.</Para>
  1225. <Para>If the callback does not consume the message <Emphasis>msg</Emphasis>, it returns the message and
  1226. passes the <Filename>TT_CALLBACK_CONTINUE</Filename> routine down the call stack to offer the
  1227. message to other callbacks, or to return it to the <Filename>tt_message_receive</Filename> call.</Para>
  1228. <Para>The <Filename>ttdt_message_accept</Filename> function registers in the default session for the
  1229. handler&hyphen;addressed requests described in
  1230. <!--Original XRef content: 'Table&numsp;A&hyphen;11'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.11">.</Para>
  1231. <Table Id="TTUG.MsgTk.tbl.19" Frame="Topbot">
  1232. <Title Id="TTUG.MsgTk.mkr.11">Requests for which ttdt_message_accept Registers</Title>
  1233. <TGroup Cols="2">
  1234. <ColSpec Colname="1" Colwidth="1.0 in">
  1235. <ColSpec Colname="2" Colwidth="6.00926 in">
  1236. <THead>
  1237. <Row>
  1238. <Entry><Para><Literal>Request</Literal></Para></Entry>
  1239. <Entry><Para><Literal>How Request Is Handled</Literal></Para></Entry>
  1240. </Row>
  1241. </THead>
  1242. <TBody>
  1243. <Row>
  1244. <Entry><Para><Command><IndexTerm>
  1245. <Primary>Get_Geometry request</Primary>
  1246. </IndexTerm>Get_Geometr
  1247. y,<IndexTerm>
  1248. <Primary>Set_Geometry request</Primary>
  1249. </IndexTerm>
  1250. Set_Geometr
  1251. y</Command></Para></Entry>
  1252. <Entry><Para>If the <Symbol Role="Variable">shell</Symbol> parameter is not null, these requests are handled transparently; if the <Symbol Role="Variable">shell</Symbol> parameter is
  1253. null and the <Emphasis>cb</Emphasis> parameter is not null, these requests are passed to the callback routine; otherwise, these
  1254. requests fail with the error<IndexTerm>
  1255. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  1256. </IndexTerm><IndexTerm>
  1257. <Primary>error messages</Primary>
  1258. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  1259. </IndexTerm>
  1260. <Filename>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  1261. </Row>
  1262. <Row>
  1263. <Entry><Para><Command><IndexTerm>
  1264. <Primary>Get_Iconified request</Primary>
  1265. </IndexTerm>Get_Iconifi
  1266. ed,<IndexTerm>
  1267. <Primary>Set_Iconified request</Primary>
  1268. </IndexTerm>
  1269. Set_Iconifi
  1270. ed</Command></Para></Entry>
  1271. <Entry><Para>If the <Symbol Role="Variable">shell</Symbol> parameter is not null, these requests are handled transparently; if the <Symbol Role="Variable">shell</Symbol> parameter is
  1272. null and the <Emphasis>cb</Emphasis> parameter is not null, these requests are passed to the callback routine; otherwise, these
  1273. requests fail with the error<IndexTerm>
  1274. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  1275. </IndexTerm><IndexTerm>
  1276. <Primary>error messages</Primary>
  1277. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  1278. </IndexTerm>
  1279. <Filename>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  1280. </Row>
  1281. <Row>
  1282. <Entry><Para><Command><IndexTerm>
  1283. <Primary>Get_Mapped request</Primary>
  1284. </IndexTerm>Get_Mapped,<IndexTerm>
  1285. <Primary>Set_Mapped request</Primary>
  1286. </IndexTerm>
  1287. Set_Mapped</Command></Para></Entry>
  1288. <Entry><Para>If the <Symbol Role="Variable">shell</Symbol> parameter is not null, these requests are handled transparently; if the <Symbol Role="Variable">shell</Symbol> parameter is
  1289. null and the <Emphasis>cb</Emphasis> parameter is not null, these requests are passed to the callback routine; otherwise, these
  1290. requests fail with the error<IndexTerm>
  1291. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  1292. </IndexTerm><IndexTerm>
  1293. <Primary>error messages</Primary>
  1294. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  1295. </IndexTerm>
  1296. <Filename>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  1297. </Row>
  1298. <Row>
  1299. <Entry><Para><Command><IndexTerm>
  1300. <Primary>Raise request</Primary>
  1301. </IndexTerm>Raise</Command></Para></Entry>
  1302. <Entry><Para>If the <Symbol Role="Variable">shell</Symbol> parameter is not null, this request is handled transparently; if the <Symbol Role="Variable">shell</Symbol> parameter is null
  1303. and the <Emphasis>cb</Emphasis> parameter is not null, these requests are passed to the callback routine; otherwise, these
  1304. requests fail with the error<IndexTerm>
  1305. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  1306. </IndexTerm><IndexTerm>
  1307. <Primary>error messages</Primary>
  1308. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  1309. </IndexTerm>
  1310. <Filename>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  1311. </Row>
  1312. <Row>
  1313. <Entry><Para><Command><IndexTerm>
  1314. <Primary>Lower request</Primary>
  1315. </IndexTerm>Lower</Command></Para></Entry>
  1316. <Entry><Para>If the <Symbol Role="Variable">shell</Symbol> parameter is not null, this request is handled transparently; if the <Symbol Role="Variable">shell</Symbol> parameter is null
  1317. and the <Emphasis>cb</Emphasis> parameter is not null, these requests are passed to the callback routine; otherwise, these
  1318. requests fail with the error<IndexTerm>
  1319. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  1320. </IndexTerm><IndexTerm>
  1321. <Primary>error messages</Primary>
  1322. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  1323. </IndexTerm>
  1324. <Filename>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  1325. </Row>
  1326. <Row>
  1327. <Entry><Para><Command>Get_XInfo</Command>,<IndexTerm>
  1328. <Primary>Get_XInfo request</Primary>
  1329. </IndexTerm>
  1330. <Command>Set_XInfo</Command><IndexTerm>
  1331. <Primary>Set_XInfo request</Primary>
  1332. </IndexTerm></Para></Entry>
  1333. <Entry><Para>If the <Symbol Role="Variable">shell</Symbol> parameter is not null, these requests are handled transparently; if the <Symbol Role="Variable">shell</Symbol> parameter is
  1334. null and the <Emphasis>cb</Emphasis> parameter is not null, these requests are passed to the callback routine; otherwise, these
  1335. requests fail with the error<IndexTerm>
  1336. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  1337. </IndexTerm><IndexTerm>
  1338. <Primary>error messages</Primary>
  1339. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  1340. </IndexTerm>
  1341. <Filename>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  1342. </Row>
  1343. <Row>
  1344. <Entry><Para><Command><IndexTerm>
  1345. <Primary>Pause request</Primary>
  1346. </IndexTerm>Pause</Command></Para></Entry>
  1347. <Entry><Para>If the <Emphasis>cb</Emphasis> parameter is not null, this request is passed to the callback routine; otherwise, it fails with the
  1348. error<IndexTerm>
  1349. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  1350. </IndexTerm><IndexTerm>
  1351. <Primary>error messages</Primary>
  1352. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  1353. </IndexTerm>
  1354. <Filename>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  1355. </Row>
  1356. <Row>
  1357. <Entry><Para><Command><IndexTerm>
  1358. <Primary>Resume request</Primary>
  1359. </IndexTerm>Resume</Command></Para></Entry>
  1360. <Entry><Para>If the <Emphasis>cb</Emphasis> parameter is not null, this request is passed to the callback routine; otherwise, it fails with the
  1361. error<IndexTerm>
  1362. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  1363. </IndexTerm><IndexTerm>
  1364. <Primary>error messages</Primary>
  1365. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  1366. </IndexTerm>
  1367. <Filename>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  1368. </Row>
  1369. <Row>
  1370. <Entry><Para><Command><IndexTerm>
  1371. <Primary>Quit request</Primary>
  1372. </IndexTerm>Quit</Command></Para></Entry>
  1373. <Entry><Para>If the <Emphasis>cb</Emphasis> parameter is not null, this request is passed to the callback routine; otherwise, it fails with the
  1374. error<IndexTerm>
  1375. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  1376. </IndexTerm><IndexTerm>
  1377. <Primary>error messages</Primary>
  1378. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  1379. </IndexTerm>
  1380. <Filename>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  1381. </Row>
  1382. <Row>
  1383. <Entry><Para><Filename><IndexTerm>
  1384. <Primary>Get_Status request</Primary>
  1385. </IndexTerm>Get_Status</Filename></Para></Entry>
  1386. <Entry><Para>If the <Emphasis>cb</Emphasis> parameter is not null, this request is passed to the callback routine; otherwise, it fails with the
  1387. error<IndexTerm>
  1388. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  1389. </IndexTerm><IndexTerm>
  1390. <Primary>error messages</Primary>
  1391. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  1392. </IndexTerm>
  1393. <Filename>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  1394. </Row>
  1395. </TBody>
  1396. </TGroup>
  1397. </Table>
  1398. <Para>If the <Emphasis>contract</Emphasis> argument has a<IndexTerm>
  1399. <Primary>TT_WRN_START_MESSAGE</Primary>
  1400. </IndexTerm>
  1401. <Filename>TT_WRN_START_MESSAGE</Filename> message status,
  1402. the message caused the tool to be started.</Para>
  1403. <Note>
  1404. <Para>The started tool should join any scopes it wants to serve before
  1405. accepting the contract so that it will receive any other messages already
  1406. dispatched to its ptype; otherwise, the tool should undeclare its ptype while it
  1407. is busy. If the tool does not join any scopes, the dispatched messages will cause
  1408. other instances of the ptype to be started.</Para>
  1409. </Note>
  1410. <Para>If the <Emphasis>accept</Emphasis> argument is true, the <Filename>ttdt_message_accept</Filename> function calls</Para>
  1411. <programlisting><IndexTerm><Primary>tt_message_accept( contract )</Primary></IndexTerm>
  1412. tt_message_accept( contract )</ProgramListing>
  1413. <Para>If the <Emphasis>sendStatus</Emphasis> argument is true, the <Filename>ttdt_message_accept</Filename> function
  1414. sends a Status notice to the requestor, using the parameters (if any) passed to
  1415. the<IndexTerm>
  1416. <Primary>ttdt_open</Primary>
  1417. </IndexTerm><IndexTerm>
  1418. <Primary>message sets</Primary>
  1419. <Secondary>toolkit</Secondary>
  1420. </IndexTerm><IndexTerm>
  1421. <Primary>ttdt_open</Primary>
  1422. </IndexTerm><IndexTerm>
  1423. <Primary>toolkit messages</Primary>
  1424. <Secondary>ttdt_open</Secondary>
  1425. </IndexTerm>
  1426. <Filename>ttdt_open</Filename> function.</Para>
  1427. <Para>This function returns a null-terminated array of <Filename>Tt_pattern</Filename>. Use the<IndexTerm>
  1428. <Primary>tttk_patterns_destroy</Primary>
  1429. </IndexTerm><IndexTerm>
  1430. <Primary>message sets</Primary>
  1431. <Secondary>toolkit</Secondary>
  1432. <Tertiary>tttk_patterns_destroy</Tertiary>
  1433. </IndexTerm><IndexTerm>
  1434. <Primary>toolkit messages</Primary>
  1435. <Secondary>tttk_patterns_destroy</Secondary>
  1436. </IndexTerm>
  1437. <Filename>tttk_patterns_destroy</Filename> function to destroy the array. If an error is
  1438. returned, the returned array is an error pointer that can be decoded with<IndexTerm>
  1439. <Primary>tt_ptr_error</Primary>
  1440. </IndexTerm>
  1441. <Filename>tt_ptr_error</Filename>.
  1442. <!--Original XRef content: 'Table&numsp;A&hyphen;12'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.12"> is a list of the possible errors returned by the
  1443. <Filename>ttdt_message_accept</Filename> function.</Para>
  1444. <Table Id="TTUG.MsgTk.tbl.20" Frame="Topbot">
  1445. <Title Id="TTUG.MsgTk.mkr.12">Possible Errors Returned by ttdt_message_accept</Title>
  1446. <TGroup Cols="2">
  1447. <ColSpec Colname="1" Colwidth="1.25 in">
  1448. <ColSpec Colname="2" Colwidth="3.73017 in">
  1449. <THead>
  1450. <Row>
  1451. <Entry><Para><Literal>Returned Error</Literal></Para></Entry>
  1452. <Entry><Para><Literal>Description</Literal></Para></Entry>
  1453. </Row>
  1454. </THead>
  1455. <TBody>
  1456. <Row>
  1457. <Entry><Para><Filename><IndexTerm>
  1458. <Primary>TT_ERR_NOMP</Primary>
  1459. </IndexTerm><IndexTerm>
  1460. <Primary>error messages</Primary>
  1461. <Secondary>TT_ERR_NOMP</Secondary>
  1462. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  1463. <Entry><Para>The ttsession process is not available. The ToolTalk service tries
  1464. to restart ttsession if it is not running. This error indicates that
  1465. the ToolTalk service is either not installed or not installed
  1466. correctly.</Para></Entry>
  1467. </Row>
  1468. <Row>
  1469. <Entry><Para><Filename><IndexTerm>
  1470. <Primary>TT_ERR_POINTER</Primary>
  1471. </IndexTerm><IndexTerm>
  1472. <Primary>error messages</Primary>
  1473. <Secondary>TT_ERR_POINTER</Secondary>
  1474. </IndexTerm>TT_ERR_POINTER</Filename></Para></Entry>
  1475. <Entry><Para>The pointer passed does not point at an object of the correct
  1476. type for this operation. For example, the pointer may point to
  1477. an integer when a character string is needed.</Para></Entry>
  1478. </Row>
  1479. <Row>
  1480. <Entry><Para><Command><IndexTerm>
  1481. <Primary>TT_ERR_UNIMP</Primary>
  1482. </IndexTerm><IndexTerm>
  1483. <Primary>error messages</Primary>
  1484. <Secondary>TT_ERR_UNIMP</Secondary>
  1485. </IndexTerm>TT_ERR_UNIMP</Command></Para></Entry>
  1486. <Entry><Para>The ttsession for the default session is a version (1.0 or 1.0.1)
  1487. that does not support the <Filename>tt_message_accept</Filename> function.</Para><Para><Literal>Note:</Literal> If the contract argument has a <Filename>TT_WRN_START_MESSAGE</Filename>
  1488. message status, messages to the tool's ptype will remain blocked
  1489. until the contract is rejected, replied to, or failed.</Para></Entry>
  1490. </Row>
  1491. </TBody>
  1492. </TGroup>
  1493. </Table>
  1494. <Example Id="TTUG.MsgTk.tbl.21">
  1495. <Title><IndexTerm>
  1496. <Primary>ttdt_open</Primary>
  1497. </IndexTerm><IndexTerm>
  1498. <Primary>message sets</Primary>
  1499. <Secondary>toolkit</Secondary>
  1500. <Tertiary>ttdt_open</Tertiary>
  1501. </IndexTerm><IndexTerm>
  1502. <Primary>toolkit messages</Primary>
  1503. <Secondary>ttdt_open</Secondary>
  1504. </IndexTerm>ttdt_open</Title>
  1505. <ProgramListing>char * ttdt_open( int * ttfd,
  1506. const char * toolname,
  1507. const char * vendor,
  1508. const char * version,
  1509. int sendStarted );
  1510. </ProgramListing>
  1511. </Example>
  1512. <Para>The <Filename>ttdt_open</Filename> function creates a ToolTalk communication endpoint. This
  1513. function calls<IndexTerm>
  1514. <Primary>tt_open function</Primary>
  1515. </IndexTerm><IndexTerm>
  1516. <Primary>ToolTalk functions</Primary>
  1517. <Secondary>tt_open</Secondary>
  1518. </IndexTerm>
  1519. <Filename>tt_open</Filename> and<IndexTerm>
  1520. <Primary>tt_fd</Primary>
  1521. </IndexTerm>
  1522. <Filename>tt_fd</Filename> functions. The <Filename>ttdt_open</Filename> function
  1523. associates <Emphasis>toolname</Emphasis>, <Emphasis>vendor</Emphasis>, and <Symbol Role="Variable">version</Symbol> with the created procid. It
  1524. initializes the new procid's default contexts from<IndexTerm>
  1525. <Primary>environ(5)</Primary>
  1526. </IndexTerm>
  1527. <Filename MoreInfo="RefEntry">environ(5)</Filename>. If the
  1528. <Emphasis>sendStarted</Emphasis> argument is set, this function sends a<IndexTerm>
  1529. <Primary>Started notice</Primary>
  1530. </IndexTerm>
  1531. Started notice.</Para>
  1532. <Para>The <Filename>ttdt_open</Filename> function returns the created procid in a string that can be
  1533. freed with the<IndexTerm>
  1534. <Primary>tt_free function</Primary>
  1535. </IndexTerm><IndexTerm>
  1536. <Primary>ToolTalk functions</Primary>
  1537. <Secondary>tt_free</Secondary>
  1538. </IndexTerm>
  1539. <Filename>tt_free</Filename> function.</Para>
  1540. <Para>This function can return any error returned by the <Filename>tt_open</Filename> and <Filename>tt_fd</Filename>
  1541. functions. If the Started notice fails, errors are not propagated.</Para>
  1542. <Example Id="TTUG.MsgTk.tbl.22">
  1543. <Title><IndexTerm>
  1544. <Primary>ttdt_Revert</Primary>
  1545. </IndexTerm><IndexTerm>
  1546. <Primary>message sets</Primary>
  1547. <Secondary>toolkit</Secondary>
  1548. <Tertiary>ttdt_Revert</Tertiary>
  1549. </IndexTerm><IndexTerm>
  1550. <Primary>toolkit messages</Primary>
  1551. <Secondary>ttdt_Revert</Secondary>
  1552. </IndexTerm>ttdt_Revert</Title>
  1553. <ProgramListing>Tt_status ttdt_Revert( Tt_message context,
  1554. const char * pathname,
  1555. Tt_scope the_scope,
  1556. XtAppContext app2run,
  1557. int ms_timeout );
  1558. </ProgramListing>
  1559. </Example>
  1560. <Para>The <Filename>ttdt_Revert</Filename> function requests a ToolTalk client to revert a file. It sends a<IndexTerm>
  1561. <Primary>Revert request</Primary>
  1562. </IndexTerm>
  1563. Revert request in <Emphasis>the_scope</Emphasis> and waits for a reply. The Revert request asks
  1564. the handling ToolTalk client to discard any changes pending on <Emphasis>pathname.</Emphasis></Para>
  1565. <ItemizedList Remap="Bullet1">
  1566. <ListItem>
  1567. <Para>If the <Symbol Role="Variable">context</Symbol> parameter is a value other than zero, messages created by
  1568. this routine inherit all contexts whose slotname begins with <Filename>ENV_</Filename>.</Para>
  1569. </ListItem>
  1570. <ListItem>
  1571. <Para>If the value of the <Emphasis>the_scope</Emphasis> parameter is zero (that is,<IndexTerm>
  1572. <Primary>TT_SCOPE_NONE</Primary>
  1573. </IndexTerm>
  1574. <Filename>TT_SCOPE_NONE</Filename>),
  1575. the file scope is set to the default (<IndexTerm>
  1576. <Primary>TT_BOTH</Primary>
  1577. </IndexTerm>
  1578. <Filename>TT_BOTH</Filename>); however, if, for example, the
  1579. ToolTalk database server rpc.ttdbserver is not installed on the file server that
  1580. owns <Symbol Role="Variable">pathname</Symbol>, the file scope is set to<IndexTerm>
  1581. <Primary>TT_FILE_IN_SESSION</Primary>
  1582. </IndexTerm>
  1583. <Filename>TT_FILE_IN_SESSION</Filename>.</Para>
  1584. </ListItem>
  1585. <ListItem>
  1586. <Para>The <Emphasis>app2run</Emphasis> and <Emphasis>ms_timeout</Emphasis> parameters are passed to the<IndexTerm>
  1587. <Primary>tttk_block_while</Primary>
  1588. </IndexTerm><IndexTerm>
  1589. <Primary>message sets</Primary>
  1590. <Secondary>toolkit</Secondary>
  1591. <Tertiary>tttk_block_while</Tertiary>
  1592. </IndexTerm><IndexTerm>
  1593. <Primary>toolkit messages</Primary>
  1594. <Secondary>tttk_block_while</Secondary>
  1595. </IndexTerm>
  1596. <Filename>tttk_block_while</Filename> function to block on the reply to the Revert request
  1597. sent by this function.</Para>
  1598. </ListItem>
  1599. </ItemizedList>
  1600. <Para>If the request receives an affirmative reply within the indicated timeout, the
  1601. <Filename>ttdt_Revert</Filename> function returns <Filename>TT_OK</Filename>; otherwise, it returns either the
  1602. <Filename><IndexTerm>
  1603. <Primary>tt_message_status</Primary>
  1604. </IndexTerm>tt_message_status</Filename> of the failure reply, or one of the errors listed in
  1605. <!--Original XRef content: 'Table&numsp;A&hyphen;13'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.13">.</Para>
  1606. <Table Id="TTUG.MsgTk.tbl.23" Frame="Topbot">
  1607. <Title Id="TTUG.MsgTk.mkr.13">Possible Errors Returned by ttdt_Revert</Title>
  1608. <TGroup Cols="2">
  1609. <ColSpec Colname="1" Colwidth="1.73611 in">
  1610. <ColSpec Colname="2" Colwidth="3.23414 in">
  1611. <THead>
  1612. <Row>
  1613. <Entry><Para><Literal>Error Returned</Literal></Para></Entry>
  1614. <Entry><Para><Literal>Description</Literal></Para></Entry>
  1615. </Row>
  1616. </THead>
  1617. <TBody>
  1618. <Row>
  1619. <Entry><Para><Filename><IndexTerm>
  1620. <Primary>TT_ERR_NOMP</Primary>
  1621. </IndexTerm><IndexTerm>
  1622. <Primary>error messages</Primary>
  1623. <Secondary>TT_ERR_NOMP</Secondary>
  1624. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  1625. <Entry><Para>The ttsession process is not available. The ToolTalk
  1626. service tries to restart ttsession if it is not running.
  1627. This error indicates that the ToolTalk service is either
  1628. not installed or not installed correctly.</Para></Entry>
  1629. </Row>
  1630. <Row>
  1631. <Entry><Para><Filename><IndexTerm>
  1632. <Primary>TT_ERR_PROCID</Primary>
  1633. </IndexTerm><IndexTerm>
  1634. <Primary>error messages</Primary>
  1635. <Secondary>TT_ERR_PROCID</Secondary>
  1636. </IndexTerm>TT_ERR_PROCID</Filename></Para></Entry>
  1637. <Entry><Para>The process identifier specified is out of date or
  1638. invalid.</Para></Entry>
  1639. </Row>
  1640. <Row>
  1641. <Entry><Para><Filename><IndexTerm>
  1642. <Primary>TT_ERR_NOMEM</Primary>
  1643. </IndexTerm><IndexTerm>
  1644. <Primary>error messages</Primary>
  1645. <Secondary>TT_ERR_NOMEM</Secondary>
  1646. </IndexTerm>TT_ERR_NOMEM</Filename></Para></Entry>
  1647. <Entry><Para>There is not enough memory available to perform the
  1648. operation.</Para></Entry>
  1649. </Row>
  1650. <Row>
  1651. <Entry><Para><Filename><IndexTerm>
  1652. <Primary>TT_ERR_OVERFLOW</Primary>
  1653. </IndexTerm><IndexTerm>
  1654. <Primary>error messages</Primary>
  1655. <Secondary>TT_ERR_OVERFLOW</Secondary>
  1656. </IndexTerm>TT_ERR_OVERFLOW</Filename></Para></Entry>
  1657. <Entry><Para>The ToolTalk service has received the maximum
  1658. amount of active messages (2000) it can properly
  1659. handle.</Para></Entry>
  1660. </Row>
  1661. <Row>
  1662. <Entry><Para><Filename><IndexTerm>
  1663. <Primary>TT_ERR_DBAVAIL</Primary>
  1664. </IndexTerm><IndexTerm>
  1665. <Primary>error messages</Primary>
  1666. <Secondary>TT_ERR_DBAVAIL</Secondary>
  1667. </IndexTerm>TT_ERR_DBAVAIL</Filename></Para></Entry>
  1668. <Entry><Para>The ToolTalk service could not access the ToolTalk
  1669. database needed for this operation.</Para></Entry>
  1670. </Row>
  1671. <Row>
  1672. <Entry><Para><Filename><IndexTerm>
  1673. <Primary>TT_ERR_DBEXIST</Primary>
  1674. </IndexTerm><IndexTerm>
  1675. <Primary>error messages</Primary>
  1676. <Secondary>TT_ERR_DBEXIST</Secondary>
  1677. </IndexTerm>TT_ERR_DBEXIST</Filename></Para></Entry>
  1678. <Entry><Para>The ToolTalk service did not find the specified
  1679. ToolTalk database in the expected place.</Para></Entry>
  1680. </Row>
  1681. <Row>
  1682. <Entry><Para><Filename><IndexTerm>
  1683. <Primary>TT_DESKTOP_ETIMEOUT</Primary>
  1684. </IndexTerm><IndexTerm>
  1685. <Primary>error messages</Primary>
  1686. <Secondary>TT_DESKTOP_ETIMEOUT</Secondary>
  1687. </IndexTerm>TT_DESKTOP_ETIMEOUT</Filename></Para></Entry>
  1688. <Entry><Para>No reply was received before the allotted timeout.</Para></Entry>
  1689. </Row>
  1690. <Row>
  1691. <Entry><Para><Filename><IndexTerm>
  1692. <Primary>TT_DESKTOP_ETPROTO</Primary>
  1693. </IndexTerm><IndexTerm>
  1694. <Primary>error messages</Primary>
  1695. <Secondary>TT_DESKTOP_EPROTO</Secondary>
  1696. </IndexTerm>TT_DESKTOP_EPROTO</Filename></Para></Entry>
  1697. <Entry><Para>The request was failed; however, the handler set the
  1698. tt_message_status of the failure reply to TT_OK
  1699. instead of a specific error status.</Para></Entry>
  1700. </Row>
  1701. <Row>
  1702. <Entry><Para><Filename><IndexTerm>
  1703. <Primary>TT_ERR_POINTER</Primary>
  1704. </IndexTerm><IndexTerm>
  1705. <Primary>error messages</Primary>
  1706. <Secondary>TT_ERR_POINTER</Secondary>
  1707. </IndexTerm>TT_ERR_POINTER</Filename></Para></Entry>
  1708. <Entry><Para>Path name was null, or was a ToolTalk error pointer.</Para></Entry>
  1709. </Row>
  1710. </TBody>
  1711. </TGroup>
  1712. </Table>
  1713. <Example Id="TTUG.MsgTk.tbl.24">
  1714. <Title><IndexTerm>
  1715. <Primary>ttdt_Save</Primary>
  1716. </IndexTerm><IndexTerm>
  1717. <Primary>message sets</Primary>
  1718. <Secondary>toolkit</Secondary>
  1719. <Tertiary>ttdt_Save</Tertiary>
  1720. </IndexTerm><IndexTerm>
  1721. <Primary>toolkit messages</Primary>
  1722. <Secondary>ttdt_Save</Secondary>
  1723. </IndexTerm>ttdt_Save</Title>
  1724. <ProgramListing>Tt_status ttdt_Save( Tt_message context,
  1725. const char * pathname,
  1726. Tt_scope the_scope,
  1727. XtAppContext app2run,
  1728. int ms_timeout );
  1729. </ProgramListing>
  1730. </Example>
  1731. <Para>The <Filename>ttdt_Save</Filename> function requests a ToolTalk client to save a file. It sends a<IndexTerm>
  1732. <Primary>Save request</Primary>
  1733. </IndexTerm>
  1734. Save request in <Emphasis>the_scope</Emphasis> and waits for a reply. The Save request asks the
  1735. handling ToolTalk client to discard any changes pending on <Emphasis>pathname.</Emphasis></Para>
  1736. <ItemizedList Remap="Bullet1">
  1737. <ListItem>
  1738. <Para>If the <Symbol Role="Variable">context</Symbol> parameter is a value other than zero, messages created by
  1739. this routine inherit all contexts whose slotname begins with <Filename>ENV_</Filename>.</Para>
  1740. </ListItem>
  1741. <ListItem>
  1742. <Para>If the value of the <Emphasis>the_scope</Emphasis> parameter is zero (that is,<IndexTerm>
  1743. <Primary>TT_SCOPE_NONE</Primary>
  1744. </IndexTerm>
  1745. <Filename>TT_SCOPE_NONE</Filename>),
  1746. the file scope is set to the default (<IndexTerm>
  1747. <Primary>TT_BOTH</Primary>
  1748. </IndexTerm>
  1749. <Filename>TT_BOTH</Filename>); however, if, for example, the
  1750. ToolTalk database server <Filename>rpc.ttdbserver</Filename> is not installed on the file server
  1751. that owns <Symbol Role="Variable">pathname</Symbol>, the file scope is set to<IndexTerm>
  1752. <Primary>TT_FILE_IN_SESSION</Primary>
  1753. </IndexTerm>
  1754. <Filename>TT_FILE_IN_SESSION</Filename>.</Para>
  1755. </ListItem>
  1756. <ListItem>
  1757. <Para>The <Emphasis>app2run</Emphasis> and <Emphasis>ms_timeout</Emphasis> parameters are passed to the<IndexTerm>
  1758. <Primary>tttk_block_while</Primary>
  1759. </IndexTerm><IndexTerm>
  1760. <Primary>message sets</Primary>
  1761. <Secondary>toolkit</Secondary>
  1762. <Tertiary>tttk_block_while</Tertiary>
  1763. </IndexTerm><IndexTerm>
  1764. <Primary>toolkit messages</Primary>
  1765. <Secondary>tttk_block_while</Secondary>
  1766. </IndexTerm>
  1767. <Filename>tttk_block_while</Filename> function to block on the reply to the Save request sent
  1768. by this function.</Para>
  1769. </ListItem>
  1770. </ItemizedList>
  1771. <Para>If the request receives an affirmative reply within the indicated timeout, the
  1772. <Filename>ttdt_Save</Filename> function returns <Filename>TT_OK</Filename>; otherwise, it returns either the
  1773. <Filename><IndexTerm>
  1774. <Primary>tt_message_status</Primary>
  1775. </IndexTerm>tt_message_status</Filename> of the failure reply, or one of the errors listed in
  1776. <!--Original XRef content: 'Table&numsp;A&hyphen;14'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.14">.</Para>
  1777. <Table Id="TTUG.MsgTk.tbl.25" Frame="Topbot">
  1778. <Title Id="TTUG.MsgTk.mkr.14">Possible Returns of the ttdt_Save function</Title>
  1779. <TGroup Cols="2">
  1780. <ColSpec Colname="1" Colwidth="1.73611 in">
  1781. <ColSpec Colname="2" Colwidth="3.23414 in">
  1782. <THead>
  1783. <Row>
  1784. <Entry><Para><Literal>Error Returned</Literal></Para></Entry>
  1785. <Entry><Para><Literal>Description</Literal></Para></Entry>
  1786. </Row>
  1787. </THead>
  1788. <TBody>
  1789. <Row>
  1790. <Entry><Para><Filename><IndexTerm>
  1791. <Primary>TT_ERR_NOMP</Primary>
  1792. </IndexTerm><IndexTerm>
  1793. <Primary>error messages</Primary>
  1794. <Secondary>TT_ERR_NOMP</Secondary>
  1795. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  1796. <Entry><Para>The ttsession process is not available. The ToolTalk
  1797. service tries to restart ttsession if it is not running.
  1798. This error indicates that the ToolTalk service is either
  1799. not installed or not installed correctly.</Para></Entry>
  1800. </Row>
  1801. <Row>
  1802. <Entry><Para><Filename><IndexTerm>
  1803. <Primary>TT_ERR_PROCID</Primary>
  1804. </IndexTerm><IndexTerm>
  1805. <Primary>error messages</Primary>
  1806. <Secondary>TT_ERR_PROCID</Secondary>
  1807. </IndexTerm>TT_ERR_PROCID</Filename></Para></Entry>
  1808. <Entry><Para>The process identifier specified is out of date or
  1809. invalid.</Para></Entry>
  1810. </Row>
  1811. <Row>
  1812. <Entry><Para><Filename><IndexTerm>
  1813. <Primary>TT_ERR_NOMEM</Primary>
  1814. </IndexTerm><IndexTerm>
  1815. <Primary>error messages</Primary>
  1816. <Secondary>TT_ERR_NOMEM</Secondary>
  1817. </IndexTerm>TT_ERR_NOMEM</Filename></Para></Entry>
  1818. <Entry><Para>There is not enough memory available to perform the
  1819. operation.</Para></Entry>
  1820. </Row>
  1821. <Row>
  1822. <Entry><Para><Filename><IndexTerm>
  1823. <Primary>TT_ERR_OVERFLOW</Primary>
  1824. </IndexTerm><IndexTerm>
  1825. <Primary>error messages</Primary>
  1826. <Secondary>TT_ERR_OVERFLOW</Secondary>
  1827. </IndexTerm>TT_ERR_OVERFLOW</Filename></Para></Entry>
  1828. <Entry><Para>The ToolTalk service has received the maximum
  1829. amount of active messages (2000) it can properly
  1830. handle.</Para></Entry>
  1831. </Row>
  1832. <Row>
  1833. <Entry><Para><Filename><IndexTerm>
  1834. <Primary>TT_ERR_DBAVAIL</Primary>
  1835. </IndexTerm><IndexTerm>
  1836. <Primary>error messages</Primary>
  1837. <Secondary>TT_ERR_DBAVAIL</Secondary>
  1838. </IndexTerm>TT_ERR_DBAVAIL</Filename></Para></Entry>
  1839. <Entry><Para>The ToolTalk service could not access the ToolTalk
  1840. database needed for this operation.</Para></Entry>
  1841. </Row>
  1842. <Row>
  1843. <Entry><Para><Filename><IndexTerm>
  1844. <Primary>TT_ERR_DBEXIST</Primary>
  1845. </IndexTerm><IndexTerm>
  1846. <Primary>error messages</Primary>
  1847. <Secondary>TT_ERR_DBEXIST</Secondary>
  1848. </IndexTerm>TT_ERR_DBEXIST</Filename></Para></Entry>
  1849. <Entry><Para>The ToolTalk service did not find the specified
  1850. ToolTalk database in the expected place.</Para></Entry>
  1851. </Row>
  1852. <Row>
  1853. <Entry><Para><Filename><IndexTerm>
  1854. <Primary>TT_DESKTOP_ETIMEOUT</Primary>
  1855. </IndexTerm><IndexTerm>
  1856. <Primary>error messages</Primary>
  1857. <Secondary>TT_DESKTOP_ETIMEOUT</Secondary>
  1858. </IndexTerm>TT_DESKTOP_ETIMEOUT</Filename></Para></Entry>
  1859. <Entry><Para>No reply was received before the allotted timeout.</Para></Entry>
  1860. </Row>
  1861. <Row>
  1862. <Entry><Para><Filename><IndexTerm>
  1863. <Primary>TT_DESKTOP_ETPROTO</Primary>
  1864. </IndexTerm><IndexTerm>
  1865. <Primary>error messages</Primary>
  1866. <Secondary>TT_DESKTOP_EPROTO</Secondary>
  1867. </IndexTerm>TT_DESKTOP_EPROTO</Filename></Para></Entry>
  1868. <Entry><Para>The request was failed; however, the handler set the
  1869. tt_message_status of the failure reply to TT_OK
  1870. instead of a specific error status.</Para></Entry>
  1871. </Row>
  1872. <Row>
  1873. <Entry><Para><Filename><IndexTerm>
  1874. <Primary>TT_ERR_POINTER</Primary>
  1875. </IndexTerm><IndexTerm>
  1876. <Primary>error messages</Primary>
  1877. <Secondary>TT_ERR_POINTER</Secondary>
  1878. </IndexTerm>TT_ERR_POINTER</Filename></Para></Entry>
  1879. <Entry><Para>Path name was null, or was a ToolTalk error pointer.</Para></Entry>
  1880. </Row>
  1881. </TBody>
  1882. </TGroup>
  1883. </Table>
  1884. <Example Id="TTUG.MsgTk.tbl.26">
  1885. <Title><IndexTerm>
  1886. <Primary>ttdt_sender_imprint_on</Primary>
  1887. </IndexTerm><IndexTerm>
  1888. <Primary>message sets</Primary>
  1889. <Secondary>toolkit</Secondary>
  1890. <Tertiary>ttdt_sender_imprint_on</Tertiary>
  1891. </IndexTerm><IndexTerm>
  1892. <Primary>toolkit messages</Primary>
  1893. <Secondary>ttdt_sender_imprint_on</Secondary>
  1894. </IndexTerm>ttdt_sender_imprint_on</Title>
  1895. <ProgramListing>Tt_status ttdt_sender_imprint_on( const char * handler,
  1896. Tt_message contract,
  1897. char ** display,
  1898. int * width,
  1899. int * height,
  1900. int * xoffset,
  1901. int * yoffset,
  1902. XtAppContext app2run,
  1903. int ms_timeout );
  1904. </ProgramListing>
  1905. </Example>
  1906. <Para>The <Filename>ttdt_sender_imprint_on</Filename> function causes the calling tool (&ldquo;ToolB&rdquo;) to
  1907. adopt the behavior and certain characteristics of another tool (&ldquo;ToolA&rdquo;). ToolB
  1908. adopts ToolA's X11 display, locale, and current working directory; it also learns
  1909. ToolA's X11 geometry so that it can position itself appropriately.</Para>
  1910. <Para>If the <Symbol Role="Variable">display</Symbol> parameter is null, the<IndexTerm>
  1911. <Primary>$DISPLAY</Primary>
  1912. </IndexTerm><IndexTerm>
  1913. <Primary>environment variables</Primary>
  1914. <Secondary>$DISPLAY</Secondary>
  1915. </IndexTerm>
  1916. environment variable <Filename>$DISPLAY</Filename> is set to
  1917. ToolA's display; otherwise, ToolA's display is returned in this parameter. The
  1918. returned value is a string that can be freed with the<IndexTerm>
  1919. <Primary>ToolTalk functions</Primary>
  1920. <Secondary>tt_free</Secondary>
  1921. </IndexTerm><IndexTerm>
  1922. <Primary>tt_free function</Primary>
  1923. </IndexTerm>
  1924. ToolTalk <Filename>tt_free</Filename>
  1925. function.</Para>
  1926. <Para>This function sends a<IndexTerm>
  1927. <Primary>Get_Geometry request</Primary>
  1928. </IndexTerm>
  1929. Get_Geometry request to ToolA. If ToolA does not return
  1930. a value for any or all of the geometry parameters:</Para>
  1931. <ItemizedList Remap="Bullet1">
  1932. <ListItem>
  1933. <Para>If a value for the <Symbol Role="Variable">width</Symbol> parameter is not returned, it is set to <Filename>-1</Filename>.</Para>
  1934. </ListItem>
  1935. <ListItem>
  1936. <Para>If a value for the <Symbol Role="Variable">height</Symbol> parameter is not returned, it is set to <Filename>-1</Filename>.</Para>
  1937. </ListItem>
  1938. <ListItem>
  1939. <Para>If a value for the <Emphasis>xoffset</Emphasis> parameter is not returned, it is set to <Filename>INT_MAX</Filename>.</Para>
  1940. </ListItem>
  1941. <ListItem>
  1942. <Para>If a value for the <Symbol Role="Variable">yoffset</Symbol> parameter is not returned, it is set to <Filename>INT_MAX</Filename>.</Para>
  1943. </ListItem>
  1944. </ItemizedList>
  1945. <Para>If the <Symbol Role="Variable">width</Symbol>, <Symbol Role="Variable">height</Symbol>, <Symbol Role="Variable">xoffset</Symbol>, and <Symbol Role="Variable">yoffset</Symbol> parameters in the
  1946. <Filename>ttdt_sender_imprint_on</Filename> function are all set to null, a<IndexTerm>
  1947. <Primary>Get_Geometry request</Primary>
  1948. </IndexTerm>
  1949. Get_Geometry
  1950. request is not sent to ToolA.</Para>
  1951. <Para>The <Emphasis>app2run</Emphasis> and <Emphasis>ms_timeout</Emphasis> parameters are passed to the<IndexTerm>
  1952. <Primary>tttk_block_while</Primary>
  1953. </IndexTerm><IndexTerm>
  1954. <Primary>message sets</Primary>
  1955. <Secondary>toolkit</Secondary>
  1956. <Tertiary>tttk_block_while</Tertiary>
  1957. </IndexTerm><IndexTerm>
  1958. <Primary>toolkit messages</Primary>
  1959. <Secondary>tttk_block_while</Secondary>
  1960. </IndexTerm>
  1961. <Filename>tttk_block_while</Filename> function to block on the replies to the Get_Geometry
  1962. request sent by this function.</Para>
  1963. <Para><!--Original XRef content: 'Table&numsp;A&hyphen;15'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.15"> lists the possible errors that can be returned by this function.</Para>
  1964. <Table Id="TTUG.MsgTk.tbl.27" Frame="Topbot">
  1965. <Title Id="TTUG.MsgTk.mkr.15">Possible Errors Returned by the ttdt_sender_imprint_on</Title>
  1966. <TGroup Cols="2">
  1967. <ColSpec Colname="1" Colwidth="1.8254 in">
  1968. <ColSpec Colname="2" Colwidth="3.16469 in">
  1969. <THead>
  1970. <Row>
  1971. <Entry><Para><Literal>Error Returned</Literal></Para></Entry>
  1972. <Entry><Para><Literal>Description</Literal></Para></Entry>
  1973. </Row>
  1974. </THead>
  1975. <TBody>
  1976. <Row>
  1977. <Entry><Para><Command><IndexTerm>
  1978. <Primary>TT_DESKTOP_ETIMEDOUT</Primary>
  1979. </IndexTerm><IndexTerm>
  1980. <Primary>error messages</Primary>
  1981. <Secondary>TT_DESKTOP_ETIMEOUT</Secondary>
  1982. </IndexTerm>TT_DESKTOP_ETIMEDOUT</Command></Para></Entry>
  1983. <Entry><Para>One or more of the sent requests did not complete
  1984. before the allotted timeout.</Para></Entry>
  1985. </Row>
  1986. <Row>
  1987. <Entry><Para><Filename><IndexTerm>
  1988. <Primary>TT_ERR_NOMP</Primary>
  1989. </IndexTerm><IndexTerm>
  1990. <Primary>error messages</Primary>
  1991. <Secondary>TT_ERR_NOMP</Secondary>
  1992. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  1993. <Entry><Para>The ttsession process is not available. The ToolTalk
  1994. service tries to restart ttsession if it is not running.
  1995. This error indicates that the ToolTalk service is either
  1996. not installed or not installed correctly.</Para></Entry>
  1997. </Row>
  1998. <Row>
  1999. <Entry><Para><Filename><IndexTerm>
  2000. <Primary>TT_ERR_PROCID</Primary>
  2001. </IndexTerm><IndexTerm>
  2002. <Primary>error messages</Primary>
  2003. <Secondary>TT_ERR_PROCID</Secondary>
  2004. </IndexTerm>TT_ERR_PROCID</Filename></Para></Entry>
  2005. <Entry><Para>The process identifier specified is out of date or
  2006. invalid.</Para></Entry>
  2007. </Row>
  2008. <Row>
  2009. <Entry><Para><Filename><IndexTerm>
  2010. <Primary>TT_ERR_NOMEM</Primary>
  2011. </IndexTerm><IndexTerm>
  2012. <Primary>error messages</Primary>
  2013. <Secondary>TT_ERR_NOMEM</Secondary>
  2014. </IndexTerm>TT_ERR_NOMEM</Filename></Para></Entry>
  2015. <Entry><Para>There is not enough memory available to perform
  2016. the operation.</Para></Entry>
  2017. </Row>
  2018. <Row>
  2019. <Entry><Para><Filename><IndexTerm>
  2020. <Primary>TT_ERR_OVERFLOW</Primary>
  2021. </IndexTerm><IndexTerm>
  2022. <Primary>error messages</Primary>
  2023. <Secondary>TT_ERR_OVERFLOW</Secondary>
  2024. </IndexTerm>TT_ERR_OVERFLOW</Filename></Para></Entry>
  2025. <Entry><Para>The ToolTalk service has received the maximum
  2026. amount of active messages (2000) it can properly
  2027. handle.</Para></Entry>
  2028. </Row>
  2029. </TBody>
  2030. </TGroup>
  2031. </Table>
  2032. <Example Id="TTUG.MsgTk.tbl.28">
  2033. <Title><IndexTerm>
  2034. <Primary>ttdt_session_join</Primary>
  2035. </IndexTerm><IndexTerm>
  2036. <Primary>message sets</Primary>
  2037. <Secondary>toolkit</Secondary>
  2038. <Tertiary>ttdt_session_join</Tertiary>
  2039. </IndexTerm><IndexTerm>
  2040. <Primary>toolkit messages</Primary>
  2041. <Secondary>ttdt_session_join</Secondary>
  2042. </IndexTerm>ttdt_session_join</Title>
  2043. <ProgramListing>Tt_message ( *Ttdt_contract_cb) ( Tt_message msg,
  2044. void * clientdata
  2045. Tt_message contract );
  2046. Tt_pattern * ttdt_session_join( const char * sessid,
  2047. Ttdt_session_cb cb,
  2048. Widget shell,
  2049. void * clientdata,
  2050. int join );
  2051. </ProgramListing>
  2052. </Example>
  2053. <Para>The <Filename>ttdt_session_join</Filename> function joins a ToolTalk session as a &ldquo;good
  2054. desktop citizen&rdquo;; that is, it registers patterns and default callbacks for many
  2055. standard desktop message interfaces when it joins the session <Emphasis>sessid</Emphasis>.
  2056. <!--Original XRef content: 'Table&numsp;A&hyphen;16'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.16"> lists the message interfaces for which this function currently
  2057. registers.</Para>
  2058. <Table Id="TTUG.MsgTk.tbl.29" Frame="Topbot">
  2059. <Title Id="TTUG.MsgTk.mkr.16">Standard Messages for which the ttdt_session_join Registers</Title>
  2060. <TGroup Cols="2">
  2061. <ColSpec Colname="1" Colwidth="1.25 in">
  2062. <ColSpec Colname="2" Colwidth="5.75 in">
  2063. <THead>
  2064. <Row>
  2065. <Entry><Para><Literal>Request</Literal></Para></Entry>
  2066. <Entry><Para><Literal>How Message Is Handled</Literal></Para></Entry>
  2067. </Row>
  2068. </THead>
  2069. <TBody>
  2070. <Row>
  2071. <Entry><Para><IndexTerm>
  2072. <Primary>Get_Environment request</Primary>
  2073. </IndexTerm>Get_Environment,<IndexTerm>
  2074. <Primary>Set_Environment request</Primary>
  2075. </IndexTerm>
  2076. Set_Environment</Para></Entry>
  2077. <Entry><Para>These messages are handled transparently.</Para></Entry>
  2078. </Row>
  2079. <Row>
  2080. <Entry><Para><IndexTerm>
  2081. <Primary>Get_Locale request</Primary>
  2082. </IndexTerm>Get_Locale,<IndexTerm>
  2083. <Primary>Set_Locale request</Primary>
  2084. </IndexTerm>
  2085. Set_Locale</Para></Entry>
  2086. <Entry><Para>These messages are handled transparently.</Para></Entry>
  2087. </Row>
  2088. <Row>
  2089. <Entry><Para><IndexTerm>
  2090. <Primary>Get_Situation request</Primary>
  2091. </IndexTerm>Get_Situation,<IndexTerm>
  2092. <Primary>Set_Situation request</Primary>
  2093. </IndexTerm>
  2094. Set_Situation</Para></Entry>
  2095. <Entry><Para>These messages are handled transparently.</Para></Entry>
  2096. </Row>
  2097. <Row>
  2098. <Entry><Para><IndexTerm>
  2099. <Primary>Signal request</Primary>
  2100. </IndexTerm>Signal</Para></Entry>
  2101. <Entry><Para>This message is handled transparently.</Para></Entry>
  2102. </Row>
  2103. <Row>
  2104. <Entry><Para><IndexTerm>
  2105. <Primary>Get_Sysinfo request</Primary>
  2106. </IndexTerm>Get_Sysinfo</Para></Entry>
  2107. <Entry><Para>This message is handled transparently.</Para></Entry>
  2108. </Row>
  2109. <Row>
  2110. <Entry><Para><IndexTerm>
  2111. <Primary>Get_Geometry request</Primary>
  2112. </IndexTerm>Get_Geometry,<IndexTerm>
  2113. <Primary>Set_Geometry request</Primary>
  2114. </IndexTerm>
  2115. Set_Geometry</Para></Entry>
  2116. <Entry><Para>If the value of the <Symbol Role="Variable">shell</Symbol> parameter is not null and the shell is a realized <Emphasis>mappedWhenManaged
  2117. applicationShellWidget</Emphasis>, these messages are handled transparently; if the shell is not a
  2118. <Emphasis>mappedWhenManaged applicationShellWidget</Emphasis>, these messages fail with the error<IndexTerm>
  2119. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  2120. </IndexTerm><IndexTerm>
  2121. <Primary>error messages</Primary>
  2122. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  2123. </IndexTerm>
  2124. <Filename>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  2125. </Row>
  2126. <Row>
  2127. <Entry><Para><IndexTerm>
  2128. <Primary>Get_Iconified request</Primary>
  2129. </IndexTerm>Get_Iconified,<IndexTerm>
  2130. <Primary>Get_Iconified request</Primary>
  2131. </IndexTerm>
  2132. Get_Iconified</Para></Entry>
  2133. <Entry><Para>If the value of the <Symbol Role="Variable">shell</Symbol> parameter is not null and the shell is a realized <Emphasis>mappedWhenManaged
  2134. applicationShellWidget</Emphasis>, these messages are handled transparently; if the shell is not a
  2135. <Emphasis>mappedWhenManaged applicationShellWidget</Emphasis>, these messages fail with the error<IndexTerm>
  2136. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  2137. </IndexTerm><IndexTerm>
  2138. <Primary>error messages</Primary>
  2139. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  2140. </IndexTerm>
  2141. <Filename>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  2142. </Row>
  2143. <Row>
  2144. <Entry><Para><Command><IndexTerm>
  2145. <Primary>Get_Mapped request</Primary>
  2146. </IndexTerm>Get_Mapped,<IndexTerm>
  2147. <Primary>Set_Mapped request</Primary>
  2148. </IndexTerm>
  2149. Set_Mapped</Command></Para></Entry>
  2150. <Entry><Para>If the value of the <Symbol Role="Variable">shell</Symbol> parameter is not null and the shell is a realized <Emphasis>mappedWhenManaged
  2151. applicationShellWidget</Emphasis>, these messages are handled transparently; if the shell is not a
  2152. <Emphasis>mappedWhenManaged applicationShellWidget</Emphasis>, these messages fail with the error<IndexTerm>
  2153. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  2154. </IndexTerm><IndexTerm>
  2155. <Primary>error messages</Primary>
  2156. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  2157. </IndexTerm>
  2158. <Filename>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  2159. </Row>
  2160. <Row>
  2161. <Entry><Para><Command><IndexTerm>
  2162. <Primary>Raise request</Primary>
  2163. </IndexTerm>Raise</Command></Para></Entry>
  2164. <Entry><Para>If the value of the <Symbol Role="Variable">shell</Symbol> parameter is not null and the shell is a realized <Emphasis>mappedWhenManaged</Emphasis>
  2165. <Emphasis>applicationShellWidget</Emphasis>, this message is handled transparently; if the shell is not a
  2166. <Emphasis>mappedWhenManaged applicationShellWidget</Emphasis>, this message fails with the error
  2167. <Filename><IndexTerm>
  2168. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  2169. </IndexTerm><IndexTerm>
  2170. <Primary>error messages</Primary>
  2171. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  2172. </IndexTerm>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  2173. </Row>
  2174. <Row>
  2175. <Entry><Para><Command><IndexTerm>
  2176. <Primary>Lower request</Primary>
  2177. </IndexTerm>Lower</Command></Para></Entry>
  2178. <Entry><Para>If the value of the <Symbol Role="Variable">shell</Symbol> parameter is not null and the shell is a realized <Emphasis>mappedWhenManaged</Emphasis>
  2179. <Emphasis>applicationShellWidget</Emphasis>, this message is handled transparently; if the shell is not a
  2180. <Emphasis>mappedWhenManaged applicationShellWidget</Emphasis>, this message fails with the error
  2181. <Filename><IndexTerm>
  2182. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  2183. </IndexTerm><IndexTerm>
  2184. <Primary>error messages</Primary>
  2185. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  2186. </IndexTerm>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  2187. </Row>
  2188. <Row>
  2189. <Entry><Para><Filename><IndexTerm>
  2190. <Primary>Get_XInfo request</Primary>
  2191. </IndexTerm>Get_XInfo</Filename></Para></Entry>
  2192. <Entry><Para>If the value of the <Symbol Role="Variable">shell</Symbol> parameter is not null, this message is handled transparently; otherwise,
  2193. this message fails with the error<IndexTerm>
  2194. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  2195. </IndexTerm><IndexTerm>
  2196. <Primary>error messages</Primary>
  2197. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  2198. </IndexTerm>
  2199. <Filename>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  2200. </Row>
  2201. <Row>
  2202. <Entry><Para><Filename><IndexTerm>
  2203. <Primary>Set_XInfo request</Primary>
  2204. </IndexTerm>Set_XInfo</Filename></Para></Entry>
  2205. <Entry><Para>If the value of the <Symbol Role="Variable">shell</Symbol> parameter is not null and the shell is a realized <Emphasis>mappedWhenManaged
  2206. applicationShellWidget</Emphasis>, this message is handled transparently; if the shell is not a
  2207. <Emphasis>mappedWhenManaged applicationShellWidget</Emphasis>, this message fails with the error
  2208. <Filename><IndexTerm>
  2209. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  2210. </IndexTerm><IndexTerm>
  2211. <Primary>error messages</Primary>
  2212. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  2213. </IndexTerm>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  2214. </Row>
  2215. <Row>
  2216. <Entry><Para><Command><IndexTerm>
  2217. <Primary>Pause request</Primary>
  2218. </IndexTerm>Pause</Command></Para></Entry>
  2219. <Entry><Para>If the <Emphasis>cb</Emphasis> parameter is not null, this message is passed to the callback; the cb parameter is null, this
  2220. message fails with the error <Filename><IndexTerm>
  2221. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  2222. </IndexTerm><IndexTerm>
  2223. <Primary>error messages</Primary>
  2224. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  2225. </IndexTerm>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  2226. </Row>
  2227. <Row>
  2228. <Entry><Para><Command><IndexTerm>
  2229. <Primary>Resume request</Primary>
  2230. </IndexTerm>Resume</Command></Para></Entry>
  2231. <Entry><Para>If the <Emphasis>cb</Emphasis> parameter is not null, this message is passed to the callback; the <Emphasis>cb</Emphasis> parameter is null, this
  2232. message fails with the error<IndexTerm>
  2233. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  2234. </IndexTerm><IndexTerm>
  2235. <Primary>error messages</Primary>
  2236. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  2237. </IndexTerm>
  2238. TT_DESKTOP_ENOTSUP.</Para></Entry>
  2239. </Row>
  2240. <Row>
  2241. <Entry><Para><Command><IndexTerm>
  2242. <Primary>Quit request</Primary>
  2243. </IndexTerm>Quit</Command></Para></Entry>
  2244. <Entry><Para>If the <Emphasis>cb</Emphasis> parameter is not null, this message is passed to the callback; the <Emphasis>cb</Emphasis> parameter is null, this
  2245. message fails with the error <Filename><IndexTerm>
  2246. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  2247. </IndexTerm><IndexTerm>
  2248. <Primary>error messages</Primary>
  2249. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  2250. </IndexTerm>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  2251. </Row>
  2252. <Row>
  2253. <Entry><Para><Filename><IndexTerm>
  2254. <Primary>Get_Status request</Primary>
  2255. </IndexTerm>Get_Status</Filename></Para></Entry>
  2256. <Entry><Para>If the <Emphasis>cb</Emphasis> parameter is not null, this message is passed to the callback; the <Emphasis>cb</Emphasis> parameter is null, this
  2257. message fails with the error <Filename><IndexTerm>
  2258. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  2259. </IndexTerm><IndexTerm>
  2260. <Primary>error messages</Primary>
  2261. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  2262. </IndexTerm>TT_DESKTOP_ENOTSUP</Filename>.</Para></Entry>
  2263. </Row>
  2264. <Row>
  2265. <Entry><Para><Filename><IndexTerm>
  2266. <Primary>Do_Command request</Primary>
  2267. </IndexTerm>Do_Command</Filename></Para></Entry>
  2268. <Entry><Para>If the <Emphasis>cb</Emphasis> parameter is not null, this message is passed to the callback; the <Emphasis>cb</Emphasis> parameter is null, this
  2269. message fails with the error <SystemItem Class="Constant"><IndexTerm>
  2270. <Primary>TT_DESKTOP_ENOTSUP</Primary>
  2271. </IndexTerm><IndexTerm>
  2272. <Primary>error messages</Primary>
  2273. <Secondary>TT_DESKTOP_ENOTSUP</Secondary>
  2274. </IndexTerm>TT_DESKTOP_ENOTSUP</SystemItem>.</Para></Entry>
  2275. </Row>
  2276. </TBody>
  2277. </TGroup>
  2278. </Table>
  2279. <Para>If the <Emphasis>sessid</Emphasis> parameter is null, the default session is joined.</Para>
  2280. <Para>If the <Emphasis>join</Emphasis> parameter is set, the specified session is joined.</Para>
  2281. <Para>A<IndexTerm>
  2282. <Primary>ttdt_contract_cb</Primary>
  2283. </IndexTerm><IndexTerm>
  2284. <Primary>message sets</Primary>
  2285. <Secondary>toolkit</Secondary>
  2286. <Tertiary>ttdt_contract_cb</Tertiary>
  2287. </IndexTerm><IndexTerm>
  2288. <Primary>toolkit messages</Primary>
  2289. <Secondary>ttdt_contract_cb</Secondary>
  2290. </IndexTerm>
  2291. <Filename>Ttdt_contract_cb</Filename> message takes the parameters described in
  2292. <!--Original XRef content: 'Table&numsp;A&hyphen;17'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.17">.
  2293. If the callback does not consume the message, it returns the message; if it
  2294. consumes the message, it returns either zero or a error pointer cast to
  2295. <Filename>Tt_message</Filename>.</Para>
  2296. <Table Id="TTUG.MsgTk.tbl.30" Frame="Topbot">
  2297. <Title Id="TTUG.MsgTk.mkr.17">Parameters taken by Ttdt_session_cb</Title>
  2298. <TGroup Cols="2">
  2299. <ColSpec Colname="1" Colwidth="1.5 in">
  2300. <ColSpec Colname="2" Colwidth="3.5 in">
  2301. <THead>
  2302. <Row>
  2303. <Entry><Para><Literal>Parameter</Literal></Para></Entry>
  2304. <Entry><Para><Literal>Description</Literal></Para></Entry>
  2305. </Row>
  2306. </THead>
  2307. <TBody>
  2308. <Row>
  2309. <Entry><Para><Filename>Tt_message</Filename> <Command>msg</Command></Para></Entry>
  2310. <Entry><Para>The request in the sent state.
  2311. The client program must either fail, reject, or reply to the
  2312. message.</Para><Para><Literal>Note</Literal>: Destroy the message <Emphasis>msg</Emphasis> after it is processed.</Para></Entry>
  2313. </Row>
  2314. <Row>
  2315. <Entry><Para><Command>void *</Command><Command>clientdata</Command></Para></Entry>
  2316. <Entry><Para>The clientdata passed to either the <Filename>ttdt_session_join</Filename>
  2317. or <Filename>ttdt_message_accept</Filename> function.</Para></Entry>
  2318. </Row>
  2319. <Row>
  2320. <Entry><Para><Filename>Tt_message</Filename> <Command>contract</Command></Para></Entry>
  2321. <Entry><Para>The contract passed to the <Filename>ttdt_message_accept</Filename>
  2322. function. If the callback is installed by the
  2323. <Filename>ttdt_session_join</Filename> function, the value for the
  2324. <Emphasis>contract</Emphasis> parameter is always zero.</Para></Entry>
  2325. </Row>
  2326. </TBody>
  2327. </TGroup>
  2328. </Table>
  2329. <Para>The <Filename>ttdt_session_join</Filename> function returns a null-terminated array of
  2330. <Filename>Tt_pattern</Filename>, which can be passed to the<IndexTerm>
  2331. <Primary>ttdt_session_quit</Primary>
  2332. </IndexTerm><IndexTerm>
  2333. <Primary>message sets</Primary>
  2334. <Secondary>toolkit</Secondary>
  2335. <Tertiary>ttdt_session_quit</Tertiary>
  2336. </IndexTerm><IndexTerm>
  2337. <Primary>toolkit messages</Primary>
  2338. <Secondary>ttdt_session_quit</Secondary>
  2339. </IndexTerm>
  2340. <Filename>ttdt_session_quit</Filename> function to be
  2341. destroyed. If an error occurs, the returned array that is an error pointer. Use
  2342. <Filename><IndexTerm>
  2343. <Primary>tt_ptr_error</Primary>
  2344. </IndexTerm>tt_ptr_error</Filename> to find the <Filename>Tt_status</Filename>.
  2345. <!--Original XRef content: 'Table&numsp;A&hyphen;18'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.18"> lists the possible errors
  2346. returned.</Para>
  2347. <Table Id="TTUG.MsgTk.tbl.31" Frame="Topbot">
  2348. <Title Id="TTUG.MsgTk.mkr.18">Possible Errors Returned by the ttdt_session_join</Title>
  2349. <TGroup Cols="2">
  2350. <ColSpec Colname="1" Colwidth="1.25 in">
  2351. <ColSpec Colname="2" Colwidth="3.75 in">
  2352. <THead>
  2353. <Row>
  2354. <Entry><Para><Literal>Error Returned</Literal></Para></Entry>
  2355. <Entry><Para><Literal>Description</Literal></Para></Entry>
  2356. </Row>
  2357. </THead>
  2358. <TBody>
  2359. <Row>
  2360. <Entry><Para><IndexTerm>
  2361. <Primary>TT_ERR_NOMP</Primary>
  2362. </IndexTerm><IndexTerm>
  2363. <Primary>error messages</Primary>
  2364. <Secondary>TT_ERR_NOMP</Secondary>
  2365. </IndexTerm>TT_ERR_NOMP</Para></Entry>
  2366. <Entry><Para>The ttsession process is not available. The ToolTalk service tries
  2367. to restart ttsession if it is not running. This error indicates that
  2368. the ToolTalk service is either not installed or not installed
  2369. correctly.</Para></Entry>
  2370. </Row>
  2371. <Row>
  2372. <Entry><Para><IndexTerm>
  2373. <Primary>TT_ERR_PROCID</Primary>
  2374. </IndexTerm><IndexTerm>
  2375. <Primary>error messages</Primary>
  2376. <Secondary>TT_ERR_PROCID</Secondary>
  2377. </IndexTerm>TT_ERR_PROCID</Para></Entry>
  2378. <Entry><Para>The process identifier specified is out of date or invalid.</Para></Entry>
  2379. </Row>
  2380. <Row>
  2381. <Entry><Para><IndexTerm>
  2382. <Primary>TT_ERR_SESSION</Primary>
  2383. </IndexTerm><IndexTerm>
  2384. <Primary>error messages</Primary>
  2385. <Secondary>TT_ERR_SESSION</Secondary>
  2386. </IndexTerm>TT_ERR_SESSION</Para></Entry>
  2387. <Entry><Para>An out&hyphen;of&hyphen;date or invalid ToolTalk session was specified.</Para></Entry>
  2388. </Row>
  2389. <Row>
  2390. <Entry><Para><IndexTerm>
  2391. <Primary>TT_ERR_POINTER</Primary>
  2392. </IndexTerm><IndexTerm>
  2393. <Primary>error messages</Primary>
  2394. <Secondary>TT_ERR_POINTER</Secondary>
  2395. </IndexTerm>TT_ERR_POINTER</Para></Entry>
  2396. <Entry><Para>The pointer passed does not point at an object of the correct
  2397. type for this operation. For example, the pointer may point to
  2398. an integer when a character string is needed.</Para></Entry>
  2399. </Row>
  2400. <Row>
  2401. <Entry><Para><IndexTerm>
  2402. <Primary>TT_ERR_NOMEM</Primary>
  2403. </IndexTerm><IndexTerm>
  2404. <Primary>error messages</Primary>
  2405. <Secondary>TT_ERR_NOMEM</Secondary>
  2406. </IndexTerm>TT_ERR_NOMEM</Para></Entry>
  2407. <Entry><Para>There is not enough memory available to perform the
  2408. operation.</Para></Entry>
  2409. </Row>
  2410. </TBody>
  2411. </TGroup>
  2412. </Table>
  2413. <Example Id="TTUG.MsgTk.tbl.32">
  2414. <Title><IndexTerm>
  2415. <Primary>ttdt_session_quit</Primary>
  2416. </IndexTerm><IndexTerm>
  2417. <Primary>message sets</Primary>
  2418. <Secondary>toolkit</Secondary>
  2419. <Tertiary>ttdt_session_quit</Tertiary>
  2420. </IndexTerm><IndexTerm>
  2421. <Primary>toolkit messages</Primary>
  2422. <Secondary>ttdt_session_quit</Secondary>
  2423. </IndexTerm>ttdt_session_quit</Title>
  2424. <ProgramListing>Tt_status ttdt_session_quit( const char * sessid,
  2425. Tt_pattern * sess_pats,
  2426. int quit );
  2427. </ProgramListing>
  2428. </Example>
  2429. <Para>The <Filename>ttdt_session_quit</Filename> function quits a ToolTalk session as a &ldquo;good
  2430. desktop citizen&rdquo;; that is, it unregisters all the patterns and default callback it
  2431. registered when it joined the session.</Para>
  2432. <Para>This function destroys all patterns in <Emphasis>sess_pats</Emphasis>. If the <Symbol Role="Variable">quit</Symbol> parameter is set,
  2433. it quits the session <Emphasis>sessid</Emphasis>; if the <Emphasis>sessid</Emphasis> parameter is null, it quits the default
  2434. session.</Para>
  2435. <Para><!--Original XRef content: 'Table&numsp;A&hyphen;19'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.19"> lists the errors that can be returned by this function.</Para>
  2436. <Table Id="TTUG.MsgTk.tbl.33" Frame="Topbot">
  2437. <Title Id="TTUG.MsgTk.mkr.19">Possible Errors Returned by the ttdt_session_quit</Title>
  2438. <TGroup Cols="2">
  2439. <ColSpec Colname="1" Colwidth="1.25 in">
  2440. <ColSpec Colname="2" Colwidth="3.75 in">
  2441. <THead>
  2442. <Row>
  2443. <Entry><Para><Literal>Error Returned</Literal></Para></Entry>
  2444. <Entry><Para><Literal>Description</Literal></Para></Entry>
  2445. </Row>
  2446. </THead>
  2447. <TBody>
  2448. <Row>
  2449. <Entry><Para><Filename><IndexTerm>
  2450. <Primary>TT_ERR_NOMP</Primary>
  2451. </IndexTerm><IndexTerm>
  2452. <Primary>error messages</Primary>
  2453. <Secondary>TT_ERR_NOMP</Secondary>
  2454. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  2455. <Entry><Para>The ttsession process is not available. The ToolTalk service tries
  2456. to restart ttsession if it is not running. This error indicates that
  2457. the ToolTalk service is either not installed or not installed
  2458. correctly.</Para></Entry>
  2459. </Row>
  2460. <Row>
  2461. <Entry><Para><Filename><IndexTerm>
  2462. <Primary>TT_ERR_PROCID</Primary>
  2463. </IndexTerm><IndexTerm>
  2464. <Primary>error messages</Primary>
  2465. <Secondary>TT_ERR_PROCID</Secondary>
  2466. </IndexTerm>TT_ERR_PROCID</Filename></Para></Entry>
  2467. <Entry><Para>The process identifier specified is out of date or invalid.</Para></Entry>
  2468. </Row>
  2469. <Row>
  2470. <Entry><Para><Filename><IndexTerm>
  2471. <Primary>TT_ERR_SESSION</Primary>
  2472. </IndexTerm><IndexTerm>
  2473. <Primary>error messages</Primary>
  2474. <Secondary>TT_ERR_SESSION</Secondary>
  2475. </IndexTerm>TT_ERR_SESSION</Filename></Para></Entry>
  2476. <Entry><Para>An out&hyphen;of&hyphen;date or invalid ToolTalk session was specified.</Para></Entry>
  2477. </Row>
  2478. <Row>
  2479. <Entry><Para><Filename><IndexTerm>
  2480. <Primary>TT_ERR_POINTER</Primary>
  2481. </IndexTerm><IndexTerm>
  2482. <Primary>error messages</Primary>
  2483. <Secondary>TT_ERR_POINTER</Secondary>
  2484. </IndexTerm>TT_ERR_POINTER</Filename></Para></Entry>
  2485. <Entry><Para>The pointer passed does not point at an object of the correct
  2486. type for this operation. For example, the pointer may point to
  2487. an integer when a character string is needed.</Para></Entry>
  2488. </Row>
  2489. </TBody>
  2490. </TGroup>
  2491. </Table>
  2492. <Example Id="TTUG.MsgTk.tbl.34">
  2493. <Title><IndexTerm>
  2494. <Primary>ttdt_subcontract_manage</Primary>
  2495. </IndexTerm><IndexTerm>
  2496. <Primary>message sets</Primary>
  2497. <Secondary>toolkit</Secondary>
  2498. <Tertiary>ttdt_subcontract_manage</Tertiary>
  2499. </IndexTerm><IndexTerm>
  2500. <Primary>toolkit messages</Primary>
  2501. <Secondary>ttdt_subcontract_manage</Secondary>
  2502. </IndexTerm>ttdt_subcontract_manage</Title>
  2503. <ProgramListing>Tt_pattern * ttdt_subcontract_manage( Tt_message subcontract,
  2504. Ttdt_contract_cb cb,
  2505. Widget shell,
  2506. void * clientdata );
  2507. </ProgramListing>
  2508. </Example>
  2509. <Para>The <Filename>ttdt_subcontract_manage</Filename> function manages an outstanding request. It
  2510. allows the requesting tool to manage the standard Desktop interactions with
  2511. the tool that is handling the request. This function registers in the default
  2512. session for <Filename>TT_HANDLER</Filename>-addressed<IndexTerm>
  2513. <Primary>Get_Geometry request</Primary>
  2514. </IndexTerm>
  2515. Get_Geometry and<IndexTerm>
  2516. <Primary>Get_XInfo request</Primary>
  2517. </IndexTerm>
  2518. Get_XInfo requests,
  2519. and<IndexTerm>
  2520. <Primary>Status notice</Primary>
  2521. </IndexTerm>
  2522. Status notices.</Para>
  2523. <Para>If the <Symbol Role="Variable">shell</Symbol> parameter is null, the request or notice is passed to the <Emphasis>cb</Emphasis>
  2524. parameter; otherwise, the request is handled transparently.</Para>
  2525. <Para>The <Filename>ttdt_subcontract_manage</Filename> function returns a null-terminated array of
  2526. Tt_pattern, which can be passed to the<IndexTerm>
  2527. <Primary>ttdt_session_quit</Primary>
  2528. </IndexTerm><IndexTerm>
  2529. <Primary>message sets</Primary>
  2530. <Secondary>toolkit</Secondary>
  2531. <Tertiary>ttdt_session_quit</Tertiary>
  2532. </IndexTerm><IndexTerm>
  2533. <Primary>toolkit messages</Primary>
  2534. <Secondary>ttdt_session_quit</Secondary>
  2535. </IndexTerm>
  2536. <Filename>ttdt_session_quit</Filename> function to be
  2537. destroyed. If an error occurs, the returned array that is an error pointer. Use
  2538. <Filename><IndexTerm>
  2539. <Primary>tt_ptr_error</Primary>
  2540. </IndexTerm>tt_ptr_error</Filename> to find the <Filename>Tt_status</Filename>.
  2541. <!--Original XRef content: 'Table&numsp;A&hyphen;20'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.20"> lists the possible errors
  2542. returned.</Para>
  2543. <Table Id="TTUG.MsgTk.tbl.35" Frame="Topbot">
  2544. <Title Id="TTUG.MsgTk.mkr.20">Possible Errors Returned by the ttdt_subcontract_manage</Title>
  2545. <TGroup Cols="2">
  2546. <ColSpec Colname="1" Colwidth="1.25 in">
  2547. <ColSpec Colname="2" Colwidth="3.72025 in">
  2548. <THead>
  2549. <Row>
  2550. <Entry><Para><Literal>Error Returned</Literal></Para></Entry>
  2551. <Entry><Para><Literal>Description</Literal></Para></Entry>
  2552. </Row>
  2553. </THead>
  2554. <TBody>
  2555. <Row>
  2556. <Entry><Para><Filename><IndexTerm>
  2557. <Primary>TT_ERR_NOMEM</Primary>
  2558. </IndexTerm><IndexTerm>
  2559. <Primary>error messages</Primary>
  2560. <Secondary>TT_ERR_NOMEM</Secondary>
  2561. </IndexTerm>TT_ERR_NOMEM</Filename></Para></Entry>
  2562. <Entry><Para>There is not enough memory available to perform the
  2563. operation.</Para></Entry>
  2564. </Row>
  2565. <Row>
  2566. <Entry><Para><Filename><IndexTerm>
  2567. <Primary>TT_ERR_NOMP</Primary>
  2568. </IndexTerm><IndexTerm>
  2569. <Primary>error messages</Primary>
  2570. <Secondary>TT_ERR_NOMP</Secondary>
  2571. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  2572. <Entry><Para>The ttsession process is not available. The ToolTalk service tries
  2573. to restart ttsession if it is not running. This error indicates that
  2574. the ToolTalk service is either not installed or not installed
  2575. correctly.</Para></Entry>
  2576. </Row>
  2577. <Row>
  2578. <Entry><Para><Filename><IndexTerm>
  2579. <Primary>TT_ERR_PROCID</Primary>
  2580. </IndexTerm><IndexTerm>
  2581. <Primary>error messages</Primary>
  2582. <Secondary>TT_ERR_PROCID</Secondary>
  2583. </IndexTerm>TT_ERR_PROCID</Filename></Para></Entry>
  2584. <Entry><Para>The process identifier specified is out of date or invalid.</Para></Entry>
  2585. </Row>
  2586. <Row>
  2587. <Entry><Para><Filename><IndexTerm>
  2588. <Primary>TT_ERR_POINTER</Primary>
  2589. </IndexTerm><IndexTerm>
  2590. <Primary>error messages</Primary>
  2591. <Secondary>TT_ERR_POINTER</Secondary>
  2592. </IndexTerm>TT_ERR_POINTER</Filename></Para></Entry>
  2593. <Entry><Para>The <Emphasis>subcontract</Emphasis> parameter was not a valid <Filename>Tt_message</Filename>.</Para></Entry>
  2594. </Row>
  2595. <Row>
  2596. <Entry><Para><Command><IndexTerm>
  2597. <Primary>TT_ERR_EINVAL</Primary>
  2598. </IndexTerm><IndexTerm>
  2599. <Primary>error messages</Primary>
  2600. <Secondary>TT_ERR_EINVAL</Secondary>
  2601. </IndexTerm>TT_ERR_EINVAL</Command></Para></Entry>
  2602. <Entry><Para>Both the <Symbol Role="Variable">shell</Symbol> and <Emphasis>cb</Emphasis> parameters were null.</Para></Entry>
  2603. </Row>
  2604. </TBody>
  2605. </TGroup>
  2606. </Table>
  2607. <Example Id="TTUG.MsgTk.tbl.36">
  2608. <Title><IndexTerm>
  2609. <Primary>ttmedia_Deposit</Primary>
  2610. </IndexTerm><IndexTerm>
  2611. <Primary>message sets</Primary>
  2612. <Secondary>toolkit</Secondary>
  2613. <Tertiary>ttmedia_Deposit</Tertiary>
  2614. </IndexTerm><IndexTerm>
  2615. <Primary>toolkit messages</Primary>
  2616. <Secondary>ttmedia_Deposit</Secondary>
  2617. </IndexTerm>ttmedia_Deposit</Title>
  2618. <ProgramListing>Tt_status ttmedia_Deposit( Tt_message load_contract,
  2619. const char * buffer_id,
  2620. const char * media_type,
  2621. const unsigned char * new_contents,
  2622. int new_len,
  2623. const char * pathname,
  2624. XtAppContext app2run,
  2625. int ms_timeout );
  2626. </ProgramListing>
  2627. </Example>
  2628. <Para>The <Filename>ttmedia_Deposit</Filename> function sends a Deposit request to checkpoint a
  2629. document that was the subject of a Media Exchange load_contract request such
  2630. as Edit, Compose, or Open.</Para>
  2631. <Para>This function creates and sends a Deposit request and returns the success or
  2632. failure of that request.</Para>
  2633. <ItemizedList Remap="Bullet1">
  2634. <ListItem>
  2635. <Para><Emphasis>load_contract</Emphasis> is the request that caused this editor to load the document</Para>
  2636. </ListItem>
  2637. <ListItem>
  2638. <Para><Emphasis>buffer_id</Emphasis> is the id of the buffer this editor created if the document was
  2639. loaded by an Open request</Para>
  2640. </ListItem>
  2641. <ListItem>
  2642. <Para><Emphasis>media_type</Emphasis> is the vtype of the <Emphasis>contents</Emphasis> argument of the sent request</Para>
  2643. </ListItem>
  2644. <ListItem>
  2645. <Para><Emphasis>new_contents</Emphasis> and new_len are the values for the <Emphasis>contents</Emphasis> argument</Para>
  2646. </ListItem>
  2647. </ItemizedList>
  2648. <Para>After the request is sent, <Emphasis>app2run</Emphasis> and <Emphasis>ms_timeout</Emphasis> are passed to the
  2649. <Filename>tttk_block_while</Filename> function to wait for the reply.</Para>
  2650. <Table Id="TTUG.MsgTk.tbl.37" Frame="Topbot">
  2651. <Title>Possible Errors Returned by the ttmedia_Deposit</Title>
  2652. <TGroup Cols="2">
  2653. <ColSpec Colname="1" Colwidth="1.5619 in">
  2654. <ColSpec Colname="2" Colwidth="3.43056 in">
  2655. <THead>
  2656. <Row>
  2657. <Entry><Para><Filename><IndexTerm>
  2658. <Primary>TT_ERR_NOMP</Primary>
  2659. </IndexTerm><IndexTerm>
  2660. <Primary>error messages</Primary>
  2661. <Secondary>TT_ERR_NOMP</Secondary>
  2662. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  2663. <Entry><Para>The ttsession process is not available. The ToolTalk
  2664. service tries to restart ttsession if it is not running. This
  2665. error indicates that the ToolTalk service is either not
  2666. installed or not installed correctly.</Para></Entry>
  2667. </Row>
  2668. </THead>
  2669. <TBody>
  2670. <Row>
  2671. <Entry><Para><Filename><IndexTerm>
  2672. <Primary>TT_ERR_PROCID</Primary>
  2673. </IndexTerm><IndexTerm>
  2674. <Primary>error messages</Primary>
  2675. <Secondary>TT_ERR_PROCID</Secondary>
  2676. </IndexTerm>TT_ERR_PROCID</Filename></Para></Entry>
  2677. <Entry><Para>The process identifier specified is out of date or invalid.</Para></Entry>
  2678. </Row>
  2679. <Row>
  2680. <Entry><Para><Filename><IndexTerm>
  2681. <Primary>TT_ERR_NOMEM</Primary>
  2682. </IndexTerm><IndexTerm>
  2683. <Primary>error messages</Primary>
  2684. <Secondary>TT_ERR_NOMEM</Secondary>
  2685. </IndexTerm>TT_ERR_NOMEM</Filename></Para></Entry>
  2686. <Entry><Para>There is not enough available memory to perform the
  2687. operation.</Para></Entry>
  2688. </Row>
  2689. <Row>
  2690. <Entry><Para><Filename><IndexTerm>
  2691. <Primary>TT_ERR_OVERFLOW</Primary>
  2692. </IndexTerm><IndexTerm>
  2693. <Primary>error messages</Primary>
  2694. <Secondary>TT_ERR_OVERFLOW</Secondary>
  2695. </IndexTerm>TT_ERR_OVERFLOW</Filename></Para></Entry>
  2696. <Entry><Para>The ToolTalk service has received the maximum amount
  2697. of active messages (2000) it can properly handle.</Para></Entry>
  2698. </Row>
  2699. <Row>
  2700. <Entry><Para><Filename><IndexTerm>
  2701. <Primary>TT_ERR_DBAVAIL</Primary>
  2702. </IndexTerm><IndexTerm>
  2703. <Primary>error messages</Primary>
  2704. <Secondary>TT_ERR_DBAVAIL</Secondary>
  2705. </IndexTerm>TT_ERR_DBAVAIL</Filename></Para></Entry>
  2706. <Entry><Para>The ToolTalk service could not access the ToolTalk
  2707. database needed for this operation.</Para></Entry>
  2708. </Row>
  2709. <Row>
  2710. <Entry><Para><Filename><IndexTerm>
  2711. <Primary>TT_ERR_DBEXIST</Primary>
  2712. </IndexTerm><IndexTerm>
  2713. <Primary>error messages</Primary>
  2714. <Secondary>TT_ERR_DBEXIST</Secondary>
  2715. </IndexTerm>TT_ERR_DBEXIST</Filename></Para></Entry>
  2716. <Entry><Para>The ToolTalk service did not find the specified ToolTalk
  2717. database in the expected place.</Para></Entry>
  2718. </Row>
  2719. <Row>
  2720. <Entry><Para><Filename><IndexTerm>
  2721. <Primary>TT_DESKTOP_ETIMEOUT</Primary>
  2722. </IndexTerm><IndexTerm>
  2723. <Primary>error messages</Primary>
  2724. <Secondary>TT_DESKTOP_ETIMEOUT</Secondary>
  2725. </IndexTerm>TT_DESKTOP_ETIMEOUT</Filename></Para></Entry>
  2726. <Entry><Para>No reply was received before the allotted timeout.</Para></Entry>
  2727. </Row>
  2728. <Row>
  2729. <Entry><Para><Filename><IndexTerm>
  2730. <Primary>TT_ERR_POINTER</Primary>
  2731. </IndexTerm><IndexTerm>
  2732. <Primary>error messages</Primary>
  2733. <Secondary>TT_ERR_POINTER</Secondary>
  2734. </IndexTerm>TT_ERR_POINTER</Filename></Para></Entry>
  2735. <Entry><Para>Path name was null, or was a ToolTalk error pointer.</Para></Entry>
  2736. </Row>
  2737. </TBody>
  2738. </TGroup>
  2739. </Table>
  2740. <Example Id="TTUG.MsgTk.tbl.38">
  2741. <Title><IndexTerm>
  2742. <Primary>ttmedia_load</Primary>
  2743. </IndexTerm><IndexTerm>
  2744. <Primary>message sets</Primary>
  2745. <Secondary>toolkit</Secondary>
  2746. <Tertiary>ttmedia_load</Tertiary>
  2747. </IndexTerm><IndexTerm>
  2748. <Primary>toolkit messages</Primary>
  2749. <Secondary>ttmedia_load</Secondary>
  2750. </IndexTerm>ttmedia_load</Title>
  2751. <ProgramListing>Tt_message (*Ttmedia_load_msg_cb) ( Tt_message msg,
  2752. void * clientdata,
  2753. Tttk_op op,
  2754. unsigned char * contents,
  2755. int len,
  2756. char * file );
  2757. Tt_message ttmedia_load( Tt_message context,
  2758. Ttmedia_load_msg_cb cb,
  2759. void * clientdata,
  2760. Tttk_op op,
  2761. const char * media_type,
  2762. const unsigned char * contents,
  2763. int len,
  2764. const char * file,
  2765. const char * docname,
  2766. int send );
  2767. </ProgramListing>
  2768. </Example>
  2769. <Para>The <Command>ttmedia_load function</Command> creates and, optionally, sends a Media
  2770. Exchange request to display, edit, or compose a document. This function
  2771. creates and sends<IndexTerm>
  2772. <Primary>Display request</Primary>
  2773. </IndexTerm>
  2774. Display,<IndexTerm>
  2775. <Primary>Edit request</Primary>
  2776. </IndexTerm>
  2777. Edit, or<IndexTerm>
  2778. <Primary>Compose request</Primary>
  2779. </IndexTerm>
  2780. Compose requests.</Para>
  2781. <Note>
  2782. <Para>Use the<IndexTerm>
  2783. <Primary>ttdt_subcontract_manage</Primary>
  2784. </IndexTerm><IndexTerm>
  2785. <Primary>message sets</Primary>
  2786. <Secondary>toolkit</Secondary>
  2787. <Tertiary>ttdt_subcontract_manage</Tertiary>
  2788. </IndexTerm><IndexTerm>
  2789. <Primary>toolkit messages</Primary>
  2790. <Secondary>ttdt_subcontract_manage</Secondary>
  2791. </IndexTerm>
  2792. <Filename>ttdt_subcontract_manage</Filename> function immediately after
  2793. sending the request created by this message to manage the standard
  2794. interactions with the handler of the request.</Para>
  2795. </Note>
  2796. <Para>If value of the <Symbol Role="Variable">context</Symbol> argument is not zero, messages created by this routine
  2797. inherit all contexts whose slotname begins with<IndexTerm>
  2798. <Primary>ENV_</Primary>
  2799. </IndexTerm>
  2800. <Filename>ENV_</Filename>.</Para>
  2801. <Para>The <Emphasis>clientdata</Emphasis> argument is passed to the <Emphasis>cb</Emphasis> argument when the reply is
  2802. received, or when intermediate versions of the document are checkpointed
  2803. through<IndexTerm>
  2804. <Primary>Deposit request</Primary>
  2805. </IndexTerm>
  2806. Deposit requests.</Para>
  2807. <Para>The <Symbol Role="Variable">op</Symbol> argument must be either<IndexTerm>
  2808. <Primary>TTME_DISPLAY</Primary>
  2809. </IndexTerm>
  2810. <Filename>TTME_DISPLAY</Filename>,<IndexTerm>
  2811. <Primary>TTME_EDIT</Primary>
  2812. </IndexTerm>
  2813. <Filename>TTME_EDIT</Filename>, or
  2814. <Filename><IndexTerm>
  2815. <Primary>TTME_COMPOSE</Primary>
  2816. </IndexTerm>TTME_COMPOSE</Filename>.</Para>
  2817. <Para>The <Emphasis>media_type</Emphasis> argument names the data format of the document. This
  2818. argument usually determines which application is chosen to handle the
  2819. request.</Para>
  2820. <Para>The <Emphasis>contents</Emphasis> and <Emphasis>len</Emphasis> arguments specify the document. If the value of both
  2821. of these arguments is zero and the value of the <Symbol Role="Variable">file</Symbol> argument is not zero, the
  2822. document is assumed to be contained in the specified file.</Para>
  2823. <Para>If the <Emphasis>docname</Emphasis> argument is not null, it is used as the title of the document.</Para>
  2824. <Para>If the <Emphasis>send</Emphasis> argument is true, the message is sent before it is returned.</Para>
  2825. <Para><!--Original XRef content: 'Table&numsp;A&hyphen;22'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.21"> lists the parameters taken by a<IndexTerm>
  2826. <Primary>Ttmedia_load_msg_cb message</Primary>
  2827. </IndexTerm>
  2828. <Filename>Ttmedia_load_msg_cb</Filename> message.</Para>
  2829. <Table Id="TTUG.MsgTk.tbl.39" Frame="Topbot">
  2830. <Title Id="TTUG.MsgTk.mkr.21">Parameters Taken by the Ttmedia_load_msg_cb</Title>
  2831. <TGroup Cols="2">
  2832. <ColSpec Colname="1" Colwidth="1.54661 in">
  2833. <ColSpec Colname="2" Colwidth="3.45339 in">
  2834. <THead>
  2835. <Row>
  2836. <Entry><Para><Literal>Parameter</Literal></Para></Entry>
  2837. <Entry><Para><Literal>Description</Literal></Para></Entry>
  2838. </Row>
  2839. </THead>
  2840. <TBody>
  2841. <Row>
  2842. <Entry><Para><Command>Tt_message msg</Command></Para></Entry>
  2843. <Entry><Para>The reply to the request, or a<IndexTerm>
  2844. <Primary>Deposit request</Primary>
  2845. </IndexTerm>
  2846. Deposit request with a
  2847. <Emphasis>messageID</Emphasis> argument that names the <Filename>t<IndexTerm>
  2848. <Primary>t_message_id</Primary>
  2849. </IndexTerm>
  2850. t_message_id</Filename> of
  2851. the load request. If the value of this parameter is a Deposit
  2852. request, the client program must either fail or reply to the
  2853. request.</Para><Para><Literal>Note</Literal>: Destroy the message <Emphasis>msg</Emphasis> after it is processed.</Para></Entry>
  2854. </Row>
  2855. <Row>
  2856. <Entry><Para><Command>Tttk_op op</Command></Para></Entry>
  2857. <Entry><Para>The operation of the message (either<IndexTerm>
  2858. <Primary>TTME_DEPOSIT</Primary>
  2859. </IndexTerm>
  2860. <Filename>TTME_DEPOSIT</Filename> or
  2861. the operation passed to the<IndexTerm>
  2862. <Primary>ttmedia_load</Primary>
  2863. </IndexTerm><IndexTerm>
  2864. <Primary>message sets</Primary>
  2865. <Secondary>toolkit</Secondary>
  2866. <Tertiary>ttmedia_load</Tertiary>
  2867. </IndexTerm><IndexTerm>
  2868. <Primary>toolkit messages</Primary>
  2869. <Secondary>ttmedia_load</Secondary>
  2870. </IndexTerm>
  2871. <Filename>ttmedia_load</Filename> message).</Para></Entry>
  2872. </Row>
  2873. <Row>
  2874. <Entry><Para><Command>unsigned char *
  2875. contents
  2876. int len
  2877. char *file</Command></Para></Entry>
  2878. <Entry><Para>The contents of the arriving document. If the <Emphasis>len</Emphasis>
  2879. argument is zero, the document is contained in the
  2880. specified file. If the <Emphasis>contents</Emphasis> or <Symbol Role="Variable">file</Symbol> arguments are
  2881. non-null, use the ToolTalk function<IndexTerm>
  2882. <Primary>tt_free function</Primary>
  2883. </IndexTerm><IndexTerm>
  2884. <Primary>ToolTalk functions</Primary>
  2885. <Secondary>tt_free</Secondary>
  2886. </IndexTerm>
  2887. <Filename>tt_free</Filename> to free them.</Para></Entry>
  2888. </Row>
  2889. <Row>
  2890. <Entry><Para><Command>void *clientdata</Command></Para></Entry>
  2891. <Entry><Para>The client data passed to the<IndexTerm>
  2892. <Primary>ttmedia_load</Primary>
  2893. </IndexTerm><IndexTerm>
  2894. <Primary>message sets</Primary>
  2895. <Secondary>toolkit</Secondary>
  2896. <Tertiary>ttmedia_load</Tertiary>
  2897. </IndexTerm><IndexTerm>
  2898. <Primary>toolkit messages</Primary>
  2899. <Secondary>ttmedia_load</Secondary>
  2900. </IndexTerm>
  2901. <Filename>ttmedia_load</Filename> message.</Para></Entry>
  2902. </Row>
  2903. </TBody>
  2904. </TGroup>
  2905. </Table>
  2906. <Para>If the message is processed successfully, the callback returns zero; if the
  2907. processing results in an error, the callback returns an error pointer cast to
  2908. <Filename>Tt_message</Filename>.</Para>
  2909. <Para>If the callback does not consume the message <Emphasis>msg</Emphasis>, it returns the message and
  2910. the toolkit passes the <Filename>TT_CALLBACK_CONTINUE</Filename> routine down the call stack to
  2911. offer the message to other callbacks, or to return it to the
  2912. <Filename>tt_message_receive</Filename> call.</Para>
  2913. <Para>Upon completion, the <Filename>ttmedia_load</Filename> function returns the request it was
  2914. asked to build. If an error occurs, this function returns an error pointer. Use
  2915. <Filename><IndexTerm>
  2916. <Primary>tt_ptr_error</Primary>
  2917. </IndexTerm>tt_ptr_error</Filename> to find the <Filename>Tt_status</Filename>.
  2918. <!--Original XRef content: 'Table&numsp;A&hyphen;23'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.22"> lists the possible errors
  2919. returned.</Para>
  2920. <Table Id="TTUG.MsgTk.tbl.40" Frame="Topbot">
  2921. <Title Id="TTUG.MsgTk.mkr.22">Possible Errors Returned by the ttmedia_load</Title>
  2922. <TGroup Cols="2">
  2923. <ColSpec Colname="1" Colwidth="1.60714 in">
  2924. <ColSpec Colname="2" Colwidth="3.39286 in">
  2925. <THead>
  2926. <Row>
  2927. <Entry><Para><Literal>Error Returned</Literal></Para></Entry>
  2928. <Entry><Para><Literal>Description</Literal></Para></Entry>
  2929. </Row>
  2930. </THead>
  2931. <TBody>
  2932. <Row>
  2933. <Entry><Para><Filename><IndexTerm>
  2934. <Primary>TT_ERR_NOMP</Primary>
  2935. </IndexTerm><IndexTerm>
  2936. <Primary>error messages</Primary>
  2937. <Secondary>TT_ERR_NOMP</Secondary>
  2938. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  2939. <Entry><Para>The ttsession process is not available. The ToolTalk
  2940. service tries to restart ttsession if it is not running. This
  2941. error indicates that the ToolTalk service is either not
  2942. installed or not installed correctly.</Para></Entry>
  2943. </Row>
  2944. <Row>
  2945. <Entry><Para><Filename><IndexTerm>
  2946. <Primary>TT_ERR_PROCID</Primary>
  2947. </IndexTerm><IndexTerm>
  2948. <Primary>error messages</Primary>
  2949. <Secondary>TT_ERR_PROCID</Secondary>
  2950. </IndexTerm>TT_ERR_PROCID</Filename></Para></Entry>
  2951. <Entry><Para>The process identifier specified is out of date or invalid.</Para></Entry>
  2952. </Row>
  2953. <Row>
  2954. <Entry><Para><Filename><IndexTerm>
  2955. <Primary>TT_ERR_NOMEM</Primary>
  2956. </IndexTerm><IndexTerm>
  2957. <Primary>error messages</Primary>
  2958. <Secondary>TT_ERR_NOMEM</Secondary>
  2959. </IndexTerm>TT_ERR_NOMEM</Filename></Para></Entry>
  2960. <Entry><Para>There is not enough memory available to perform the
  2961. operation.</Para></Entry>
  2962. </Row>
  2963. <Row>
  2964. <Entry><Para><Filename><IndexTerm>
  2965. <Primary>TT_ERR_OVERFLOW</Primary>
  2966. </IndexTerm><IndexTerm>
  2967. <Primary>error messages</Primary>
  2968. <Secondary>TT_ERR_OVERFLOW</Secondary>
  2969. </IndexTerm>TT_ERR_OVERFLOW</Filename></Para></Entry>
  2970. <Entry><Para>The ToolTalk service has received the maximum amount
  2971. of active messages (2000) it can properly handle.</Para></Entry>
  2972. </Row>
  2973. </TBody>
  2974. </TGroup>
  2975. </Table>
  2976. <Example Id="TTUG.MsgTk.tbl.41">
  2977. <Title><IndexTerm>
  2978. <Primary>ttmedia_load_reply</Primary>
  2979. </IndexTerm><IndexTerm>
  2980. <Primary>message sets</Primary>
  2981. <Secondary>toolkit</Secondary>
  2982. <Tertiary>ttmedia_load_reply</Tertiary>
  2983. </IndexTerm><IndexTerm>
  2984. <Primary>toolkit messages</Primary>
  2985. <Secondary>ttmedia_load_reply</Secondary>
  2986. </IndexTerm>ttmedia_load_reply</Title>
  2987. <ProgramListing>Tt_message ttmedia_load_reply ( Tt_message contract,
  2988. const unsigned char * new_contents,
  2989. int new_len,
  2990. int reply_and_destroy );
  2991. </ProgramListing>
  2992. </Example>
  2993. <Para>Use the <Filename>ttmedia_load_reply</Filename> function to reply to a Media Exchange request
  2994. to display, edit, or compose a document.</Para>
  2995. <Para>If both the <Emphasis>new_contents</Emphasis> and <Emphasis>new_len</Emphasis> arguments are non-zero, their value
  2996. is used to set the new contents of the document in the appropriate output
  2997. argument of the <Emphasis>contract</Emphasis> argument. If the <Emphasis>reply_and_destroy</Emphasis> argument
  2998. is true, a reply is made to the <Emphasis>contract</Emphasis> argument and then the message is
  2999. destroyed.</Para>
  3000. <Para><!--Original XRef content: 'Table&numsp;A&hyphen;24'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.23"> lists the possible errors returned.</Para>
  3001. <Table Id="TTUG.MsgTk.tbl.42" Frame="Topbot">
  3002. <Title Id="TTUG.MsgTk.mkr.23">Possible Errors Returned by the ttmedia_load_reply</Title>
  3003. <TGroup Cols="2">
  3004. <ColSpec Colname="1" Colwidth="1.60714 in">
  3005. <ColSpec Colname="2" Colwidth="3.39286 in">
  3006. <THead>
  3007. <Row>
  3008. <Entry><Para><Literal>Error Returned</Literal></Para></Entry>
  3009. <Entry><Para><Literal>Description</Literal></Para></Entry>
  3010. </Row>
  3011. </THead>
  3012. <TBody>
  3013. <Row>
  3014. <Entry><Para><Filename><IndexTerm>
  3015. <Primary>TT_ERR_NOMP</Primary>
  3016. </IndexTerm><IndexTerm>
  3017. <Primary>error messages</Primary>
  3018. <Secondary>TT_ERR_NOMP</Secondary>
  3019. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  3020. <Entry><Para>The ttsession process is not available. The ToolTalk
  3021. service tries to restart ttsession if it is not running. This
  3022. error indicates that the ToolTalk service is either not
  3023. installed or not installed correctly.</Para></Entry>
  3024. </Row>
  3025. <Row>
  3026. <Entry><Para><Filename><IndexTerm>
  3027. <Primary>TT_ERR_PROCID</Primary>
  3028. </IndexTerm><IndexTerm>
  3029. <Primary>error messages</Primary>
  3030. <Secondary>TT_ERR_PROCID</Secondary>
  3031. </IndexTerm>TT_ERR_PROCID</Filename></Para></Entry>
  3032. <Entry><Para>The process identifier specified is out of date or invalid.</Para></Entry>
  3033. </Row>
  3034. <Row>
  3035. <Entry><Para><Filename><IndexTerm>
  3036. <Primary>TT_ERR_NUM</Primary>
  3037. </IndexTerm><IndexTerm>
  3038. <Primary>error messages</Primary>
  3039. <Secondary>TT_ERR_NUM</Secondary>
  3040. </IndexTerm>TT_ERR_NUM</Filename></Para></Entry>
  3041. <Entry></Entry>
  3042. </Row>
  3043. <Row>
  3044. <Entry><Para><Filename><IndexTerm>
  3045. <Primary>TT_ERR_NOTHANDLER</Primary>
  3046. </IndexTerm><IndexTerm>
  3047. <Primary>error messages</Primary>
  3048. <Secondary>TT_ERR_NOTHANDLER</Secondary>
  3049. </IndexTerm>TT_ERR_NOTHANDLER</Filename></Para></Entry>
  3050. <Entry></Entry>
  3051. </Row>
  3052. </TBody>
  3053. </TGroup>
  3054. </Table>
  3055. <Example Id="TTUG.MsgTk.tbl.43">
  3056. <Title><IndexTerm>
  3057. <Primary>ttmedia_ptype_declare</Primary>
  3058. </IndexTerm><IndexTerm>
  3059. <Primary>message sets</Primary>
  3060. <Secondary>toolkit</Secondary>
  3061. <Tertiary>ttmedia_ptype_declare</Tertiary>
  3062. </IndexTerm><IndexTerm>
  3063. <Primary>toolkit messages</Primary>
  3064. <Secondary>ttmedia_ptype_declare</Secondary>
  3065. </IndexTerm>ttmedia_ptype_declare</Title>
  3066. <ProgramListing>Tt_message (*Ttmedia_load_pat_cb) ( Tt_message msg,
  3067. void * clientdata,
  3068. Tttk_op op,
  3069. Tt_status diagnosis,
  3070. unsigned char * contents,
  3071. int len,
  3072. char * file,
  3073. char * docname );
  3074. Tt_status ttmedia_ptype_declare( const char * ptype,
  3075. int base_opnum,
  3076. Ttmedia_load_pat_cb cb,
  3077. void * clientdata,
  3078. int declare );
  3079. </ProgramListing>
  3080. </Example>
  3081. <Para>The <Filename>ttmedia_ptype_declare</Filename> function declares the ptype of a Media
  3082. Exchange media editor. This function initializes an editor that implements the
  3083. Media Exchange message interface for a particular media type.</Para>
  3084. <ItemizedList Remap="Bullet1">
  3085. <ListItem>
  3086. <Para>It calls the <Emphasis>cb</Emphasis> argument when the editor is asked to edit a document of the
  3087. kind supported by <Emphasis>ptype</Emphasis>.</Para>
  3088. </ListItem>
  3089. <ListItem>
  3090. <Para>It installs a toolkit-internal operation number (<Emphasis>opnum</Emphasis>) callback on a series of
  3091. signatures that the ptype is assumed to contain. The toolkit-internal opnum
  3092. callback passes <Emphasis>clientdata</Emphasis> to the <Emphasis>cb</Emphasis> argument when a request is received
  3093. that matches one of these signatures. The opnums start at <Emphasis>base_opnum</Emphasis>,
  3094. which must be zero or a multiple of 1000.</Para>
  3095. </ListItem>
  3096. <ListItem>
  3097. <Para>If the <Emphasis>declare</Emphasis> argument is true, it calls</Para>
  3098. </ListItem>
  3099. </ItemizedList>
  3100. <programlisting><IndexTerm><Primary>tt_ptype_declare( ptype )</Primary></IndexTerm>
  3101. tt_ptype_declare( ptype )</ProgramListing>
  3102. <Para>If the ptype implements several different media types, the
  3103. <Filename>ttmedia_ptype_declare</Filename> function can be called multiple times. Each call
  3104. must have a different <Emphasis>base_opnum</Emphasis> value.</Para>
  3105. <Note>
  3106. <Para>The <Filename>ttmedia_ptype_declare</Filename> function can be called multiple times;
  3107. however, the <Emphasis>declare</Emphasis> argument can &ldquo;true&rdquo; only once.</Para>
  3108. </Note>
  3109. <Para><!--Original XRef content: 'Table&numsp;A&hyphen;25'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.24"> lists the parameters taken by a<IndexTerm>
  3110. <Primary>Ttmedia_load_pat_cb message</Primary>
  3111. </IndexTerm>
  3112. <Filename>Ttmedia_load_pat_cb</Filename> message.</Para>
  3113. <Table Id="TTUG.MsgTk.tbl.44" Frame="Topbot">
  3114. <Title Id="TTUG.MsgTk.mkr.24">Parameters Taken by Ttmedia_load_pat_cb</Title>
  3115. <TGroup Cols="2">
  3116. <ColSpec Colname="1" Colwidth="1.75926 in">
  3117. <ColSpec Colname="2" Colwidth="3.24074 in">
  3118. <THead>
  3119. <Row>
  3120. <Entry><Para><Literal>Parameter</Literal></Para></Entry>
  3121. <Entry><Para><Literal>Description</Literal></Para></Entry>
  3122. </Row>
  3123. </THead>
  3124. <TBody>
  3125. <Row>
  3126. <Entry><Para><Command>Tt_message msg</Command></Para></Entry>
  3127. <Entry><Para>The request sent. The client program must either fail,
  3128. reject, or reply to the request.</Para></Entry>
  3129. </Row>
  3130. <Row>
  3131. <Entry></Entry>
  3132. <Entry></Entry>
  3133. </Row>
  3134. <Row>
  3135. <Entry><Para><Command>Tttk_op op</Command></Para></Entry>
  3136. <Entry><Para>The operation of the incoming request (either<IndexTerm>
  3137. <Primary>TTME_COMPOSE</Primary>
  3138. </IndexTerm>
  3139. <Filename>TTME_COMPOSE</Filename>,<IndexTerm>
  3140. <Primary>TTME_EDIT</Primary>
  3141. </IndexTerm>
  3142. <Filename>TTME_EDIT</Filename>, or <Filename><IndexTerm>
  3143. <Primary>TTME_DISPLAY</Primary>
  3144. </IndexTerm>TTME_DISPLAY</Filename>.</Para></Entry>
  3145. </Row>
  3146. <Row>
  3147. <Entry><Para><Command>Tt_status diagnosis</Command></Para></Entry>
  3148. <Entry><Para>The error code with which the toolkit recommends the
  3149. request should be failed (for example,
  3150. <Filename><IndexTerm>
  3151. <Primary>TT_DESKTOP_ENODATA</Primary>
  3152. </IndexTerm><IndexTerm>
  3153. <Primary>error messages</Primary>
  3154. <Secondary>TT_DESKTOP</Secondary>
  3155. </IndexTerm>TT_DESKTOP_ENODATA</Filename>). If the diagnosis is not <Filename>TT_OK</Filename>
  3156. and the callback routine returns the message <Emphasis>msg</Emphasis>, the
  3157. toolkit fails the message <Emphasis>msg</Emphasis> and destroys it.</Para></Entry>
  3158. </Row>
  3159. <Row>
  3160. <Entry><Para><Command>unsigned char *
  3161. contents
  3162. int len
  3163. char *file</Command></Para></Entry>
  3164. <Entry><Para>The contents of the arriving document. If the <Emphasis>len</Emphasis>
  3165. argument is zero, the document is contained in
  3166. specified file. If value of the <Emphasis>contents</Emphasis> or <Symbol Role="Variable">file</Symbol>
  3167. arguments is non-null, use the ToolTalk function<IndexTerm>
  3168. <Primary>tt_free function</Primary>
  3169. </IndexTerm><IndexTerm>
  3170. <Primary>ToolTalk functions</Primary>
  3171. <Secondary>tt_free</Secondary>
  3172. </IndexTerm>
  3173. tt_free to free them.</Para></Entry>
  3174. </Row>
  3175. <Row>
  3176. <Entry><Para><Command>char * docname</Command></Para></Entry>
  3177. <Entry><Para>The name of the document, if any.</Para></Entry>
  3178. </Row>
  3179. <Row>
  3180. <Entry><Para><Command>void * clientdata</Command></Para></Entry>
  3181. <Entry><Para>The client data passed to the
  3182. <Filename>ttmedia_ptype_declare</Filename> message.</Para></Entry>
  3183. </Row>
  3184. </TBody>
  3185. </TGroup>
  3186. </Table>
  3187. <Para>If the message is processed successfully, the callback returns zero; if the
  3188. processing results in an error, the callback returns an error pointer cast to
  3189. <Filename>Tt_message</Filename>.</Para>
  3190. <Para>If the callback does not consume the message <Emphasis>msg</Emphasis> and the value of the
  3191. <Emphasis>diagnosis</Emphasis> argument is not <Filename>TT_OK</Filename>, it returns the message and the toolkit
  3192. passes the <Filename>TT_CALLBACK_CONTINUE</Filename> routine down the call stack to offer the
  3193. message to other callbacks, or to return it to the <Filename>tt_message_receive</Filename> call.</Para>
  3194. <Para>If an error occurs, this function returns one of the errors listed in
  3195. <!--Original XRef content: 'Table&numsp;A&hyphen;26'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.25">.</Para>
  3196. <Table Id="TTUG.MsgTk.tbl.45" Frame="Topbot">
  3197. <Title Id="TTUG.MsgTk.mkr.25">Possible Errors Returned by the ttmedia_ptype_declare</Title>
  3198. <TGroup Cols="2">
  3199. <ColSpec Colname="1" Colwidth="1.25 in">
  3200. <ColSpec Colname="2" Colwidth="3.75 in">
  3201. <THead>
  3202. <Row>
  3203. <Entry><Para><Literal>Error Returned</Literal></Para></Entry>
  3204. <Entry><Para><Literal>Description</Literal></Para></Entry>
  3205. </Row>
  3206. </THead>
  3207. <TBody>
  3208. <Row>
  3209. <Entry><Para><Filename><IndexTerm>
  3210. <Primary>TT_ERR_NOMP</Primary>
  3211. </IndexTerm><IndexTerm>
  3212. <Primary>error messages</Primary>
  3213. <Secondary>TT_ERR_NOMP</Secondary>
  3214. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  3215. <Entry><Para>The ttsession process is not available. The ToolTalk service tries
  3216. to restart ttsession if it is not running. This error indicates that
  3217. the ToolTalk service is either not installed or not installed
  3218. correctly.</Para></Entry>
  3219. </Row>
  3220. <Row>
  3221. <Entry><Para><Filename><IndexTerm>
  3222. <Primary>TT_ERR_PROCID</Primary>
  3223. </IndexTerm><IndexTerm>
  3224. <Primary>error messages</Primary>
  3225. <Secondary>TT_ERR_PROCID</Secondary>
  3226. </IndexTerm>TT_ERR_PROCID</Filename></Para></Entry>
  3227. <Entry><Para>The process identifier specified is out of date or invalid.</Para></Entry>
  3228. </Row>
  3229. <Row>
  3230. <Entry><Para><Filename><IndexTerm>
  3231. <Primary>TT_ERR_PTYPE</Primary>
  3232. </IndexTerm><IndexTerm>
  3233. <Primary>error messages</Primary>
  3234. <Secondary>TT_ERR_PTYPE</Secondary>
  3235. </IndexTerm>TT_ERR_PTYPE</Filename></Para></Entry>
  3236. <Entry><Para>The ToolTalk service could not locate the specified ptype.</Para></Entry>
  3237. </Row>
  3238. <Row>
  3239. <Entry><Para><Filename><IndexTerm>
  3240. <Primary>TT_ERR_POINTER</Primary>
  3241. </IndexTerm><IndexTerm>
  3242. <Primary>error messages</Primary>
  3243. <Secondary>TT_ERR_POINTER</Secondary>
  3244. </IndexTerm>TT_ERR_POINTER</Filename></Para></Entry>
  3245. <Entry><Para>The pointer passed does not point at an object of the correct
  3246. type for this operation. For example, the pointer may point to
  3247. an integer when a character string is needed.</Para></Entry>
  3248. </Row>
  3249. </TBody>
  3250. </TGroup>
  3251. </Table>
  3252. <Example Id="TTUG.MsgTk.tbl.46">
  3253. <Title><IndexTerm>
  3254. <Primary>tttk_block_while</Primary>
  3255. </IndexTerm><IndexTerm>
  3256. <Primary>message sets</Primary>
  3257. <Secondary>toolkit</Secondary>
  3258. <Tertiary>tttk_block_while</Tertiary>
  3259. </IndexTerm><IndexTerm>
  3260. <Primary>toolkit messages</Primary>
  3261. <Secondary>tttk_block_while</Secondary>
  3262. </IndexTerm>tttk_block_while</Title>
  3263. <ProgramListing>Tt_status tttk_block_while( const int * blocked,
  3264. int ms_timeout );
  3265. </ProgramListing>
  3266. </Example>
  3267. <Para>The <Command>tttk_block_while</Command> function blocks the program while it awaits a reply
  3268. for the <Emphasis>ms_timout</Emphasis> time.</Para>
  3269. <Example Id="TTUG.MsgTk.tbl.47">
  3270. <Title><IndexTerm>
  3271. <Primary>tttk_message_abandon</Primary>
  3272. </IndexTerm><IndexTerm>
  3273. <Primary>message sets</Primary>
  3274. <Secondary>toolkit</Secondary>
  3275. <Tertiary>tttk_message_abandon</Tertiary>
  3276. </IndexTerm><IndexTerm>
  3277. <Primary>toolkit messages</Primary>
  3278. <Secondary>tttk_message_abandon</Secondary>
  3279. </IndexTerm>tttk_message_abandon</Title>
  3280. <ProgramListing>Tt_status tttk_message_abandon ( Tt_message msg );
  3281. </ProgramListing>
  3282. </Example>
  3283. <Para>The <Filename>tttk_message_abandon</Filename> function abandons the request, and then
  3284. destroys it.</Para>
  3285. <Note>
  3286. <Para>A program should abandon a message when it does not understand the
  3287. message and wants to dispose of it.</Para>
  3288. </Note>
  3289. <Para>If an error occurs, this function returns one of the errors listed in
  3290. <!--Original XRef content: 'Table&numsp;A&hyphen;27'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.26">.</Para>
  3291. <Table Id="TTUG.MsgTk.tbl.48" Frame="Topbot">
  3292. <Title Id="TTUG.MsgTk.mkr.26">Possible Errors Returned by the tttk_message_abandon</Title>
  3293. <TGroup Cols="2">
  3294. <ColSpec Colname="1" Colwidth="1.75 in">
  3295. <ColSpec Colname="2" Colwidth="3.25 in">
  3296. <THead>
  3297. <Row>
  3298. <Entry><Para><Literal>Error Returned</Literal></Para></Entry>
  3299. <Entry><Para><Literal>Description</Literal></Para></Entry>
  3300. </Row>
  3301. </THead>
  3302. <TBody>
  3303. <Row>
  3304. <Entry><Para><Filename><IndexTerm>
  3305. <Primary>TT_ERR_NOMP</Primary>
  3306. </IndexTerm><IndexTerm>
  3307. <Primary>error messages</Primary>
  3308. <Secondary>TT_ERR_NOMP</Secondary>
  3309. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  3310. <Entry><Para>The ttsession process is not available. The ToolTalk
  3311. service tries to restart ttsession if it is not running. This
  3312. error indicates that the ToolTalk service is either not
  3313. installed or not installed correctly.</Para></Entry>
  3314. </Row>
  3315. <Row>
  3316. <Entry><Para><Filename><IndexTerm>
  3317. <Primary>TT_ERR_POINTER</Primary>
  3318. </IndexTerm><IndexTerm>
  3319. <Primary>error messages</Primary>
  3320. <Secondary>TT_ERR_POINTER</Secondary>
  3321. </IndexTerm>TT_ERR_POINTER</Filename></Para></Entry>
  3322. <Entry><Para>The pointer passed does not point at an object of the
  3323. correct type for this operation. For example, the
  3324. pointer may point to an integer when a character
  3325. string is needed.</Para></Entry>
  3326. </Row>
  3327. <Row>
  3328. <Entry><Para><Filename><IndexTerm>
  3329. <Primary>TT_ERR_NOTHANDLER</Primary>
  3330. </IndexTerm><IndexTerm>
  3331. <Primary>error messages</Primary>
  3332. <Secondary>TT_ERR_NOTHANDLER</Secondary>
  3333. </IndexTerm>TT_ERR_NOTHANDLER</Filename></Para></Entry>
  3334. <Entry></Entry>
  3335. </Row>
  3336. </TBody>
  3337. </TGroup>
  3338. </Table>
  3339. <Example Id="TTUG.MsgTk.tbl.49">
  3340. <Title><IndexTerm>
  3341. <Primary>tttk_message_create</Primary>
  3342. </IndexTerm><IndexTerm>
  3343. <Primary>message sets</Primary>
  3344. <Secondary>toolkit</Secondary>
  3345. <Tertiary>tttk_message_create</Tertiary>
  3346. </IndexTerm><IndexTerm>
  3347. <Primary>toolkit messages</Primary>
  3348. <Secondary>tttk_message_create</Secondary>
  3349. </IndexTerm>tttk_message_create</Title>
  3350. <ProgramListing>Tt_message tttk_message_create( Tt_message context,
  3351. Tt_class the_class,
  3352. Tt_scope the_scope,
  3353. const char * handler,
  3354. const char * op,
  3355. Tt_message_callback callback );
  3356. </ProgramListing>
  3357. </Example>
  3358. <Para>The <Filename>tttk_message_create</Filename> function creates a message that conforms to the
  3359. conventions. This function provides a simple way to create a message that
  3360. propagates inherited contexts from one message to another.</Para>
  3361. <Para>The <Filename>tttk_message_create</Filename> function creates a message and copies onto it all
  3362. the context slots from <Symbol Role="Variable">context</Symbol> whose slotname begins with <Filename>ENV_</Filename>. The created
  3363. message is given a <Filename>Tt_class</Filename> value of <Emphasis>the_class</Emphasis> and a <Filename>Tt_scope</Filename> value of
  3364. <Emphasis>the_scope</Emphasis>.</Para>
  3365. <Para>If the <Emphasis>handler</Emphasis> parameter is null, the message is given a <Filename>Tt_address</Filename> of
  3366. <Filename><IndexTerm>
  3367. <Primary>TT_PROCEDURE</Primary>
  3368. </IndexTerm>TT_PROCEDURE</Filename>; otherwise, the message is <Filename>TT_HANDLER</Filename>&hyphen;addressed to that
  3369. procid.</Para>
  3370. <Para>If the <Symbol Role="Variable">op</Symbol> argument is not null, the message's <Symbol Role="Variable">op</Symbol> argument is set to that value.</Para>
  3371. <Para>If the callback argument is not null, it is added to the message as a message
  3372. callback.</Para>
  3373. <Para>If successful, the <Filename>tttk_message_create</Filename> function returns the created
  3374. <Filename>Tt_message</Filename>, which can be modified, sent, and destroyed in the same way as
  3375. any other <Filename>Tt_message</Filename>.</Para>
  3376. <Para>If an error occurs, an error pointer is returned. Use<IndexTerm>
  3377. <Primary>tt_ptr_error</Primary>
  3378. </IndexTerm>
  3379. <Filename>tt_ptr_error</Filename> to find the
  3380. <Filename>Tt_status</Filename>.
  3381. <!--Original XRef content: 'Table&numsp;A&hyphen;28'--><XRef Role="CodeOrFigureOrTable" Linkend="TTUG.MsgTk.mkr.27"> lists the possible errors returned.</Para>
  3382. <Table Id="TTUG.MsgTk.tbl.50" Frame="Topbot">
  3383. <Title Id="TTUG.MsgTk.mkr.27">Possible Errors Returned by the tttk_message_create</Title>
  3384. <TGroup Cols="2">
  3385. <ColSpec Colname="1" Colwidth="1.25 in">
  3386. <ColSpec Colname="2" Colwidth="3.75926 in">
  3387. <THead>
  3388. <Row>
  3389. <Entry><Para><Literal>Error Returned</Literal></Para></Entry>
  3390. <Entry><Para><Literal>Description</Literal></Para></Entry>
  3391. </Row>
  3392. </THead>
  3393. <TBody>
  3394. <Row>
  3395. <Entry><Para><Filename><IndexTerm>
  3396. <Primary>TT_ERR_NOMP</Primary>
  3397. </IndexTerm><IndexTerm>
  3398. <Primary>error messages</Primary>
  3399. <Secondary>TT_ERR_NOMP</Secondary>
  3400. </IndexTerm>TT_ERR_NOMP</Filename></Para></Entry>
  3401. <Entry><Para>The ttsession process is not available. The ToolTalk service tries
  3402. to restart ttsession if it is not running. This error indicates that
  3403. the ToolTalk service is either not installed or not installed
  3404. correctly.</Para></Entry>
  3405. </Row>
  3406. <Row>
  3407. <Entry><Para><Filename><IndexTerm>
  3408. <Primary>TT_ERR_PROCID</Primary>
  3409. </IndexTerm><IndexTerm>
  3410. <Primary>error messages</Primary>
  3411. <Secondary>TT_ERR_PROCID</Secondary>
  3412. </IndexTerm>TT_ERR_PROCID</Filename></Para></Entry>
  3413. <Entry><Para>The process identifier specified is out of date or invalid.</Para></Entry>
  3414. </Row>
  3415. <Row>
  3416. <Entry><Para><Filename><IndexTerm>
  3417. <Primary>TT_ERR_NOMEM</Primary>
  3418. </IndexTerm><IndexTerm>
  3419. <Primary>error messages</Primary>
  3420. <Secondary>TT_ERR_NOMEM</Secondary>
  3421. </IndexTerm>TT_ERR_NOMEM</Filename></Para></Entry>
  3422. <Entry><Para>There is not enough memory available to perform the
  3423. operation.</Para></Entry>
  3424. </Row>
  3425. </TBody>
  3426. </TGroup>
  3427. </Table>
  3428. <Example Id="TTUG.MsgTk.tbl.51">
  3429. <Title><IndexTerm>
  3430. <Primary>tttk_message_destroy</Primary>
  3431. </IndexTerm><IndexTerm>
  3432. <Primary>message sets</Primary>
  3433. <Secondary>toolkit</Secondary>
  3434. <Tertiary>tttk_message_destroy</Tertiary>
  3435. </IndexTerm><IndexTerm>
  3436. <Primary>toolkit messages</Primary>
  3437. <Secondary>tttk_message_destroy</Secondary>
  3438. </IndexTerm>tttk_message_destroy</Title>
  3439. <ProgramListing>Tt_status tttk_message_destroy ( Tt_message msg );
  3440. </ProgramListing>
  3441. </Example>
  3442. <Para>The <Filename>tttk_message_destroy</Filename> function destroys any message that conforms to
  3443. the conventions.</Para>
  3444. <Note>
  3445. <Para>This message can be used in place of the<IndexTerm>
  3446. <Primary>tt_message_destroy message</Primary>
  3447. </IndexTerm>
  3448. <Filename>tt_message_destroy</Filename>
  3449. message.</Para>
  3450. </Note>
  3451. <Para>The <Filename>tttk_message_destroy</Filename> function destroys any patterns that may have
  3452. been stored on the message by the <Filename>ttdt_message_accept</Filename> or
  3453. <Filename>ttdt_subcontract_manage</Filename> functions and then passes the message <Emphasis>msg</Emphasis> to
  3454. the <Filename>tt_message_destroy</Filename> function.</Para>
  3455. <Para>This function returns the value returned by the <Filename>tt_message_destroy</Filename>
  3456. function.</Para>
  3457. <Example Id="TTUG.MsgTk.tbl.52">
  3458. <Title><IndexTerm>
  3459. <Primary>tttk_message_fail</Primary>
  3460. </IndexTerm><IndexTerm>
  3461. <Primary>message sets</Primary>
  3462. <Secondary>toolkit</Secondary>
  3463. <Tertiary>tttk_message_fail</Tertiary>
  3464. </IndexTerm><IndexTerm>
  3465. <Primary>toolkit messages</Primary>
  3466. <Secondary>tttk_message_fail</Secondary>
  3467. </IndexTerm>tttk_message_fail</Title>
  3468. <ProgramListing>Tt_status tttk_message_fail( Tt_message msg,
  3469. Tt_status status,
  3470. const char * status_string,
  3471. int destroy );
  3472. </ProgramListing>
  3473. </Example>
  3474. <Para>The <Filename>tttk_message_fail</Filename> function fails the message <Emphasis>msg</Emphasis> and then destroys it.</Para>
  3475. <Note>
  3476. <Para>A program should abandon a message when it does not understand the
  3477. message and wants to dispose of it.</Para>
  3478. </Note>
  3479. <Para>A message whose state is <Filename>TT_SENT</Filename> can be failed. If the message is a
  3480. handler&hyphen;addressed message, or if it has a tt_message_status of
  3481. <Filename><IndexTerm>
  3482. <Primary>TT_WRN_START_MESSAGE</Primary>
  3483. </IndexTerm>TT_WRN_START_MESSAGE</Filename>, it can be failed.</Para>
  3484. <Para>This function returns <Filename>TT_DESKTOP_ENOTSUP</Filename>.</Para>
  3485. <Example Id="TTUG.MsgTk.tbl.53">
  3486. <Title><IndexTerm>
  3487. <Primary>tttk_message_receive</Primary>
  3488. </IndexTerm><IndexTerm>
  3489. <Primary>message sets</Primary>
  3490. <Secondary>toolkit</Secondary>
  3491. <Tertiary>tttk_message_receive</Tertiary>
  3492. </IndexTerm><IndexTerm>
  3493. <Primary>toolkit messages</Primary>
  3494. <Secondary>tttk_message_receive</Secondary>
  3495. </IndexTerm><IndexTerm>
  3496. <Primary>tttk_message_receive</Primary>
  3497. </IndexTerm><IndexTerm>
  3498. <Primary>message sets</Primary>
  3499. <Secondary>toolkit</Secondary>
  3500. <Tertiary>tttk_message_receive</Tertiary>
  3501. </IndexTerm><IndexTerm>
  3502. <Primary>toolkit messages</Primary>
  3503. <Secondary>tttk_message_receive</Secondary>
  3504. </IndexTerm>tttk_message_receive</Title>
  3505. <ProgramListing>Tt_status tttk_message_receive( const char* procid );
  3506. </ProgramListing>
  3507. </Example>
  3508. <Para>The <Filename>tttk_message_receive</Filename> function calls the<IndexTerm>
  3509. <Primary>tt_message_receive</Primary>
  3510. </IndexTerm>
  3511. <Filename>tt_message_receive</Filename>
  3512. function to retrieve the next ToolTalk message.</Para>
  3513. <Para>If <ComputerOutput>procid</ComputerOutput> != 0, this function calls</Para>
  3514. <ProgramListing>tt_default_procid_set( procid )</ProgramListing>
  3515. <Example Id="TTUG.MsgTk.tbl.54">
  3516. <Title><IndexTerm>
  3517. <Primary>tttk_message_reject</Primary>
  3518. </IndexTerm><IndexTerm>
  3519. <Primary>message sets</Primary>
  3520. <Secondary>toolkit</Secondary>
  3521. <Tertiary>tttk_message_reject</Tertiary>
  3522. </IndexTerm><IndexTerm>
  3523. <Primary>toolkit messages</Primary>
  3524. <Secondary>tttk_message_reject</Secondary>
  3525. </IndexTerm><IndexTerm>
  3526. <Primary>tttk_message_reject</Primary>
  3527. </IndexTerm><IndexTerm>
  3528. <Primary>message sets</Primary>
  3529. <Secondary>toolkit</Secondary>
  3530. <Tertiary>tttk_message_reject</Tertiary>
  3531. </IndexTerm><IndexTerm>
  3532. <Primary>toolkit messages</Primary>
  3533. <Secondary>tttk_message_reject</Secondary>
  3534. </IndexTerm>tttk_message_reject</Title>
  3535. <ProgramListing>Tt_status tttk_message_reject( Tt_message msg,
  3536. Tt_status status,
  3537. const char* status_string,
  3538. int destroy );
  3539. </ProgramListing>
  3540. </Example>
  3541. <Para>The <Filename>tttk_message_reject</Filename> function rejects the message <Emphasis>msg</Emphasis> and then
  3542. destroys it.</Para>
  3543. <Note>
  3544. <Para>A program should abandon a message when it does not understand the
  3545. message and wants to dispose of it.</Para>
  3546. </Note>
  3547. <Para>A message whose state is <Filename>TT_SENT</Filename> can be rejected. If the message is <Symbol Role="Variable">not</Symbol> a
  3548. handler&hyphen;addressed message, or if it has a tt_message_status other than
  3549. <Filename><IndexTerm>
  3550. <Primary>TT_WRN_START_MESSAGE</Primary>
  3551. </IndexTerm>TT_WRN_START_MESSAGE</Filename>, it can be rejected.</Para>
  3552. <Para>This function returns <Filename>TT_DESKTOP_ENOTSUP</Filename>.</Para>
  3553. <Example Id="TTUG.MsgTk.tbl.55">
  3554. <Title><IndexTerm>
  3555. <Primary>tttk_op_string</Primary>
  3556. </IndexTerm><IndexTerm>
  3557. <Primary>message sets</Primary>
  3558. <Secondary>toolkit</Secondary>
  3559. <Tertiary>tttk_op_string</Tertiary>
  3560. </IndexTerm><IndexTerm>
  3561. <Primary>toolkit messages</Primary>
  3562. <Secondary>tttk_op_string</Secondary>
  3563. </IndexTerm>tttk_op_string</Title>
  3564. <ProgramListing>char *tttk_op_string( Tttk_op op);
  3565. </ProgramListing>
  3566. </Example>
  3567. <Para>The <Filename>tttk_op_string</Filename> function returns string for the operation <Symbol Role="Variable">op</Symbol> if
  3568. successful; otherwise, this function returns zero.</Para>
  3569. <Note>
  3570. <Para>Use the <Filename>tt_free</Filename> function to free the string returned.</Para>
  3571. </Note>
  3572. <ProgramListing>Tttk_op tttk_string_op( const char * opstring );</ProgramListing>
  3573. <Para>The <Filename>tttk_string_op</Filename> function returns a string containg the operation for the
  3574. specified string. On error, this function returns <Filename>TTDT_OP_NONE</Filename>.</Para>
  3575. <Example Id="TTUG.MsgTk.tbl.56">
  3576. <Title><IndexTerm>
  3577. <Primary>tttk_Xt_input_handler</Primary>
  3578. </IndexTerm><IndexTerm>
  3579. <Primary>message sets</Primary>
  3580. <Secondary>toolkit</Secondary>
  3581. <Tertiary>tttk_Xt_input_handler</Tertiary>
  3582. </IndexTerm><IndexTerm>
  3583. <Primary>toolkit messages</Primary>
  3584. <Secondary>tttk_Xt_input_handler</Secondary>
  3585. </IndexTerm>tttk_Xt_input_handler</Title>
  3586. <ProgramListing>void tttk_Xt_input_handler( XtPointer procid,
  3587. int * source,
  3588. XtInputId * id );
  3589. </ProgramListing>
  3590. </Example>
  3591. <Para>The <Filename>tttk_Xt_input_handler</Filename> function processes ToolTalk events for Xt
  3592. clients. Use this function as your Xt input handler unless you expect some
  3593. messages not to be consumed by callbacks.</Para>
  3594. <Para>This function passes the <Emphasis>procid</Emphasis> argument to the<IndexTerm>
  3595. <Primary>tttk_message_receive function</Primary>
  3596. </IndexTerm>
  3597. <Filename>tttk_message_receive</Filename>
  3598. function and passes any returned message (that is, messages that are not
  3599. consumed by callbacks) to the <Filename><IndexTerm>
  3600. <Primary>tttk_message_abandon</Primary>
  3601. </IndexTerm>tttk_message_abandon</Filename> function.</Para>
  3602. <Para>If this function returns the error<IndexTerm>
  3603. <Primary>TT_ERR_NOMP</Primary>
  3604. </IndexTerm><IndexTerm>
  3605. <Primary>error messages</Primary>
  3606. <Secondary>TT_ERR_NOMP</Secondary>
  3607. </IndexTerm>
  3608. <Filename>TT_ERR_NOMP</Filename>, the <Filename>tttk_Xt_input_handler</Filename>
  3609. function will pass the <Emphasis>id</Emphasis> parameter to the<IndexTerm>
  3610. <Primary>XtRemoveInput functio</Primary>
  3611. </IndexTerm>
  3612. <Command>XtRemoveInput</Command> function.</Para>
  3613. </Sect1>
  3614. </Appendix>
  3615. <!--fickle 1.14 mif-to-docbook 1.7 01/02/96 05:02:32-->