EdAppend.sgm 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <!-- $XConsortium: EdAppend.sgm /main/6 1996/09/08 20:03:03 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. <![ %CDE.C.CDE; [<RefEntry Id="CDEMX.XCSA.MAN14.rsml.1">]]>
  10. <![ %CDE.C.XO; [<RefEntry Id="XCSA.MAN14.rsml.1">]]>
  11. <RefMeta>
  12. <RefEntryTitle>DtEditorAppend</RefEntryTitle>
  13. <ManVolNum>library call</ManVolNum>
  14. </RefMeta>
  15. <RefNameDiv>
  16. <RefName><Function>DtEditorAppend</Function></RefName>
  17. <RefPurpose>append data to a DtEditor widget
  18. </RefPurpose>
  19. </RefNameDiv>
  20. <!-- CDE Common Source Format, Version 1.0.0-->
  21. <!-- *************************************************************************-->
  22. <!-- ** (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company-->
  23. <!-- ** (c) Copyright 1993, 1994, 1995 International Business Machines Corp.-->
  24. <!-- ** (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.-->
  25. <!-- ** (c) Copyright 1993, 1994, 1995 Novell, Inc.-->
  26. <!-- *************************************************************************-->
  27. <RefSynopsisDiv>
  28. <FuncSynopsis Remap="ANSI">
  29. <FuncSynopsisInfo>#include &lt;Dt/Editor.h>
  30. </FuncSynopsisInfo>
  31. <FuncDef>DtEditorErrorCode <Function>DtEditorAppend</Function></FuncDef>
  32. <ParamDef>Widget <Parameter>widget</Parameter></ParamDef>
  33. <ParamDef>DtEditorContentRec *<Parameter>data</Parameter></ParamDef>
  34. </FuncSynopsis>
  35. </RefSynopsisDiv>
  36. <RefSect1>
  37. <Title>DESCRIPTION</Title>
  38. <Para>The
  39. <Function>DtEditorAppend</Function> function appends either a
  40. <SystemItem Class="Constant">NULL</SystemItem>-terminated string, wide character string or sized buffer
  41. after the last character in a DtEditor widget.
  42. The data is transferred to the DtEditor widget using a
  43. <StructName Role="typedef">DtEditorContentRec</StructName>, which indicates the
  44. type of data being transferred along with the actual data.
  45. After the data is appended, the insertion cursor is positioned at the
  46. new last character.
  47. </Para>
  48. <Para>The
  49. <Symbol Role="Variable">widget</Symbol> argument specifies the DtEditor widget ID.
  50. </Para>
  51. <Para>The
  52. <Symbol Role="Variable">data</Symbol> argument points to the data structure containing the data to append.
  53. <![ %CDE.C.CDE; [</Para>
  54. <Para>For a complete definition of the DtEditor widget
  55. and its associated resources, see
  56. &cdeman.DtEditor;. ]]></Para>
  57. <Para>For a complete definition of
  58. <StructName Role="typedef">DtEditorContentRec</StructName>, see
  59. &cdeman.Dt.Editor.h;.</Para>
  60. </RefSect1>
  61. <RefSect1>
  62. <Title>RETURN VALUE</Title>
  63. <![ %CDE.C.XO; [
  64. <Para>Upon successful completion, the
  65. <Function>DtEditorAppend</Function> function returns
  66. <SystemItem Class="Constant">DtEDITOR_NO_ERRORS</SystemItem>; otherwise, it returns one of the following values:
  67. </Para>
  68. ]]>
  69. <![ %CDE.C.CDE; [
  70. <Para>Upon successful completion, the
  71. <Function>DtEditorAppend</Function> function returns one of the following values:
  72. </Para>
  73. <VariableList>
  74. <VarListEntry>
  75. <Term>DtEDITOR_NO_ERRORS</Term>
  76. <ListItem>
  77. <Para>The data was appended sucessfully.
  78. </Para>
  79. </ListItem>
  80. </VarListEntry>
  81. <VarListEntry>
  82. <Term>DtEDITOR_NULLS_REMOVED</Term>
  83. <ListItem>
  84. <Para>NULL characters were found and removed from the data.
  85. </Para>
  86. </ListItem>
  87. </VarListEntry>
  88. </VariableList>
  89. <Para>Otherwise, if
  90. the
  91. <Function>DtEditorAppend</Function> function
  92. cannot append the data into the DtEditor widget,
  93. it returns one of the following values:
  94. </Para>
  95. ]]>
  96. <VariableList>
  97. <VarListEntry>
  98. <Term>DtEDITOR_INVALID_TYPE</Term>
  99. <ListItem>
  100. <Para>The
  101. <Symbol Role="Variable">type</Symbol> field is unrecognized.
  102. </Para>
  103. </ListItem>
  104. </VarListEntry>
  105. <VarListEntry>
  106. <Term>DtEDITOR_ILLEGAL_SIZE</Term>
  107. <ListItem>
  108. <Para>The size of the buffer passed in is negative.
  109. </Para>
  110. </ListItem>
  111. </VarListEntry>
  112. <VarListEntry>
  113. <Term>DtEDITOR_NULL_ITEM</Term>
  114. <ListItem>
  115. <Para>The buffer is
  116. <SystemItem Class="Constant">NULL</SystemItem>. <![ %CDE.C.CDE; [</Para>
  117. </ListItem>
  118. </VarListEntry>
  119. <VarListEntry>
  120. <Term>DtEDITOR_INSUFFICIENT_MEMORY</Term>
  121. <ListItem>
  122. <Para>Not enough system memory is available to append the data.
  123. ]]></Para>
  124. </ListItem>
  125. </VarListEntry>
  126. </VariableList>
  127. </RefSect1>
  128. <RefSect1>
  129. <Title>EXAMPLES</Title>
  130. <Para>The following code segment sets the contents of a DtEditor
  131. widget to ``The quick brown fox.''
  132. </Para>
  133. <InformalExample Remap="indent">
  134. <ProgramListing>Widget editor;
  135. DtEditorContentRec cr;
  136. DtEditorErrorCode status;
  137. char *sampleString1="The quick",
  138. *secondString2=" brown fox";
  139. cr.type = DtEDITOR_TEXT;
  140. cr.value.string = sampleString1;
  141. status = DtEditorSetContents(editor, &amp;cr);
  142. <![ %CDE.C.XO; [if (status != DtEDITOR_NO_ERRORS) {
  143. ]]><![ %CDE.C.CDE; [if (status != DtEDITOR_NO_ERRORS &amp;&amp; status != DtEDITOR_NULLS_REMOVED) {
  144. ]]> printf("Unable to set the contents of the widget&bsol;n");
  145. } else {
  146. cr.type = DtEDITOR_TEXT;
  147. cr.value.string = sampleString2;
  148. status = DtEditorAppend(editor, &amp;cr);
  149. if (status != DtEDITOR_NO_ERRORS)
  150. printf("Unable to append to the contents of the widget&bsol;n");
  151. }
  152. </ProgramListing>
  153. </InformalExample>
  154. </RefSect1>
  155. <RefSect1>
  156. <Title>APPLICATION USAGE</Title>
  157. <Para>If the data is in a disk file, rather than in memory, the application should
  158. use
  159. &cdeman.DtEditorAppendFromFile;.</Para>
  160. </RefSect1>
  161. <RefSect1>
  162. <Title>SEE ALSO</Title>
  163. <Para>&cdeman.Dt.Editor.h;, &cdeman.DtEditor;, &cdeman.DtEditorAppendFromFile;, &cdeman.DtEditorGetContents;, &cdeman.DtEditorInsert;, &cdeman.DtEditorInsertFromFile;, &cdeman.DtEditorReplace;, &cdeman.DtEditorReplaceFromFile;, &cdeman.DtEditorSaveContentsToFile;, &cdeman.DtEditorSetContents;, &cdeman.DtEditorSetContentsFromFile;.</Para>
  164. </RefSect1>
  165. </RefEntry>
  166. <!--fickle 1.12 mancsf-to-docbook 1.2 08/07/95 23:40:24-->