EdReplFF.sgm 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <!-- $XConsortium: EdReplFF.sgm /main/5 1996/08/30 13:01:18 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.MAN36.rsml.1">]]>
  10. <![ %CDE.C.XO; [<RefEntry Id="XCSA.MAN36.rsml.1">]]>
  11. <RefMeta>
  12. <RefEntryTitle>DtEditorReplaceFromFile</RefEntryTitle>
  13. <ManVolNum>library call</ManVolNum>
  14. </RefMeta>
  15. <RefNameDiv>
  16. <RefName><Function>DtEditorReplaceFromFile</Function></RefName>
  17. <RefPurpose>replace a portion of the contents of a DtEditor widget with the contents of a file
  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>DtEditorReplaceFromFile</Function></FuncDef>
  32. <ParamDef>Widget <Parameter>widget</Parameter></ParamDef>
  33. <ParamDef>XmTextPosition <Parameter>startPos</Parameter></ParamDef>
  34. <ParamDef>XmTextPosition <Parameter>endPos</Parameter></ParamDef>
  35. <ParamDef>char *<Parameter>fileName</Parameter></ParamDef>
  36. </FuncSynopsis>
  37. </RefSynopsisDiv>
  38. <RefSect1>
  39. <Title>DESCRIPTION</Title>
  40. <Para>The
  41. <Function>DtEditorReplaceFromFile</Function> function
  42. replaces part of the contents of a DtEditor widget
  43. with the contents of a file.
  44. All data following the start position
  45. and up to, but not including, the end position is replaced.
  46. If the start position and the end position are equal, the
  47. data is inserted after the end position.
  48. The character positions begin at zero and are numbered sequentially
  49. from the beginning of the text.
  50. After the replacement, the insertion cursor is positioned after the
  51. last character inserted.
  52. </Para>
  53. <Para>The
  54. <Symbol Role="Variable">widget</Symbol> argument specifies the DtEditor widget ID.
  55. </Para>
  56. <Para>The
  57. <Symbol Role="Variable">startPos</Symbol> argument specifies the starting character position of
  58. the portion to replace.
  59. The replacement begins
  60. at this character.
  61. </Para>
  62. <Para>The
  63. <Symbol Role="Variable">endPos</Symbol> argument specifies the ending character position of
  64. the portion to replace.
  65. The replacement ends
  66. before this character.
  67. </Para>
  68. <Para>The
  69. <Emphasis>fileName</Emphasis> argument is the pathname of the file
  70. relative to the local system.
  71. <![ %CDE.C.CDE; [</Para>
  72. <Para>For a complete definition of the DtEditor widget
  73. and its associated resources, see
  74. &cdeman.DtEditor;. ]]></Para>
  75. </RefSect1>
  76. <RefSect1>
  77. <Title>RETURN VALUE</Title>
  78. <Para>Upon successful completion, the
  79. <Function>DtEditorReplaceFromFile</Function> function returns one of the following values:
  80. </Para>
  81. <VariableList>
  82. <VarListEntry>
  83. <Term>DtEDITOR_NO_ERRORS</Term>
  84. <ListItem>
  85. <Para>The file is readable and writable.
  86. </Para>
  87. </ListItem>
  88. </VarListEntry>
  89. <VarListEntry>
  90. <Term>DtEDITOR_READ_ONLY_FILE</Term>
  91. <ListItem>
  92. <Para>The file is read only.
  93. <![ %CDE.C.CDE; [</Para>
  94. </ListItem>
  95. </VarListEntry>
  96. <VarListEntry>
  97. <Term>DtEDITOR_NULLS_REMOVED</Term>
  98. <ListItem>
  99. <Para>The file contained embedded
  100. <SystemItem Class="Constant">NULL</SystemItem> characters, which were removed.
  101. ]]></Para>
  102. </ListItem>
  103. </VarListEntry>
  104. </VariableList>
  105. <Para>Otherwise, if it cannot insert the data into the DtEditor widget,
  106. the function
  107. returns one of the following values:
  108. </Para>
  109. <VariableList>
  110. <VarListEntry>
  111. <Term>DtEDITOR_INVALID_RANGE</Term>
  112. <ListItem>
  113. <Para>The
  114. <Symbol Role="Variable">startPos</Symbol> argument is greater than the
  115. <Symbol Role="Variable">endPos</Symbol> argument.
  116. </Para>
  117. </ListItem>
  118. </VarListEntry>
  119. <VarListEntry>
  120. <Term>DtEDITOR_NONEXISTENT_FILE</Term>
  121. <ListItem>
  122. <Para>The file does not exist.
  123. </Para>
  124. </ListItem>
  125. </VarListEntry>
  126. <VarListEntry>
  127. <Term>DtEDITOR_DIRECTORY</Term>
  128. <ListItem>
  129. <Para>The file is a directory.
  130. </Para>
  131. </ListItem>
  132. </VarListEntry>
  133. <VarListEntry>
  134. <Term>DtEDITOR_CHAR_SPECIAL_FILE</Term>
  135. <ListItem>
  136. <Para>The file is a character-special device.
  137. </Para>
  138. </ListItem>
  139. </VarListEntry>
  140. <VarListEntry>
  141. <Term>DtEDITOR_BLOCK_MODE_FILE</Term>
  142. <ListItem>
  143. <Para>The file is a block-mode device.
  144. </Para>
  145. </ListItem>
  146. </VarListEntry>
  147. <VarListEntry>
  148. <Term>DtEDITOR_NO_FILE_ACCESS</Term>
  149. <ListItem>
  150. <Para>The file cannot be accessed.
  151. <![ %CDE.C.CDE; [</Para>
  152. </ListItem>
  153. </VarListEntry>
  154. <VarListEntry>
  155. <Term>DtEDITOR_INSUFFICIENT_MEMORY</Term>
  156. <ListItem>
  157. <Para>Not enough system memory is available to replace the data.
  158. ]]></Para>
  159. </ListItem>
  160. </VarListEntry>
  161. <VarListEntry>
  162. <Term>DtEDITOR_UNREADABLE_FILE</Term>
  163. <ListItem>
  164. <Para>The file is unreadable for an unspecified reason.
  165. </Para>
  166. </ListItem>
  167. </VarListEntry>
  168. </VariableList>
  169. </RefSect1>
  170. <RefSect1>
  171. <Title>APPLICATION USAGE</Title>
  172. <Para>If the data is in memory, rather than a disk file, the application should
  173. use
  174. &cdeman.DtEditorReplace;.</Para>
  175. </RefSect1>
  176. <RefSect1>
  177. <Title>SEE ALSO</Title>
  178. <Para>&cdeman.Dt.Editor.h;, &cdeman.DtEditor;, &cdeman.DtEditorAppend;, &cdeman.DtEditorAppendFromFile;, &cdeman.DtEditorGetContents;, &cdeman.DtEditorInsert;, &cdeman.DtEditorInsertFromFile;, &cdeman.DtEditorReplace;, &cdeman.DtEditorSaveContentsToFile;, &cdeman.DtEditorSetContents;, &cdeman.DtEditorSetContentsFromFile;.</Para>
  179. </RefSect1>
  180. </RefEntry>
  181. <!--fickle 1.12 mancsf-to-docbook 1.2 08/07/95 23:40:24-->