123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <!-- $XConsortium: EdReplFF.sgm /main/5 1996/08/30 13:01:18 rws $ -->
- <!-- (c) Copyright 1995 Digital Equipment Corporation. -->
- <!-- (c) Copyright 1995 Hewlett-Packard Company. -->
- <!-- (c) Copyright 1995 International Business Machines Corp. -->
- <!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
- <!-- (c) Copyright 1995 Novell, Inc. -->
- <!-- (c) Copyright 1995 FUJITSU LIMITED. -->
- <!-- (c) Copyright 1995 Hitachi. -->
- <![ %CDE.C.CDE; [<RefEntry Id="CDEMX.XCSA.MAN36.rsml.1">]]>
- <![ %CDE.C.XO; [<RefEntry Id="XCSA.MAN36.rsml.1">]]>
- <RefMeta>
- <RefEntryTitle>DtEditorReplaceFromFile</RefEntryTitle>
- <ManVolNum>library call</ManVolNum>
- </RefMeta>
- <RefNameDiv>
- <RefName><Function>DtEditorReplaceFromFile</Function></RefName>
- <RefPurpose>replace a portion of the contents of a DtEditor widget with the contents of a file
- </RefPurpose>
- </RefNameDiv>
- <!-- CDE Common Source Format, Version 1.0.0-->
- <!-- *************************************************************************-->
- <!-- ** (c) Copyright 1993, 1994, 1995 Hewlett-Packard Company-->
- <!-- ** (c) Copyright 1993, 1994, 1995 International Business Machines Corp.-->
- <!-- ** (c) Copyright 1993, 1994, 1995 Sun Microsystems, Inc.-->
- <!-- ** (c) Copyright 1993, 1994, 1995 Novell, Inc.-->
- <!-- *************************************************************************-->
- <RefSynopsisDiv>
- <FuncSynopsis Remap="ANSI">
- <FuncSynopsisInfo>#include <Dt/Editor.h>
- </FuncSynopsisInfo>
- <FuncDef>DtEditorErrorCode <Function>DtEditorReplaceFromFile</Function></FuncDef>
- <ParamDef>Widget <Parameter>widget</Parameter></ParamDef>
- <ParamDef>XmTextPosition <Parameter>startPos</Parameter></ParamDef>
- <ParamDef>XmTextPosition <Parameter>endPos</Parameter></ParamDef>
- <ParamDef>char *<Parameter>fileName</Parameter></ParamDef>
- </FuncSynopsis>
- </RefSynopsisDiv>
- <RefSect1>
- <Title>DESCRIPTION</Title>
- <Para>The
- <Function>DtEditorReplaceFromFile</Function> function
- replaces part of the contents of a DtEditor widget
- with the contents of a file.
- All data following the start position
- and up to, but not including, the end position is replaced.
- If the start position and the end position are equal, the
- data is inserted after the end position.
- The character positions begin at zero and are numbered sequentially
- from the beginning of the text.
- After the replacement, the insertion cursor is positioned after the
- last character inserted.
- </Para>
- <Para>The
- <Symbol Role="Variable">widget</Symbol> argument specifies the DtEditor widget ID.
- </Para>
- <Para>The
- <Symbol Role="Variable">startPos</Symbol> argument specifies the starting character position of
- the portion to replace.
- The replacement begins
- at this character.
- </Para>
- <Para>The
- <Symbol Role="Variable">endPos</Symbol> argument specifies the ending character position of
- the portion to replace.
- The replacement ends
- before this character.
- </Para>
- <Para>The
- <Emphasis>fileName</Emphasis> argument is the pathname of the file
- relative to the local system.
- <![ %CDE.C.CDE; [</Para>
- <Para>For a complete definition of the DtEditor widget
- and its associated resources, see
- &cdeman.DtEditor;. ]]></Para>
- </RefSect1>
- <RefSect1>
- <Title>RETURN VALUE</Title>
- <Para>Upon successful completion, the
- <Function>DtEditorReplaceFromFile</Function> function returns one of the following values:
- </Para>
- <VariableList>
- <VarListEntry>
- <Term>DtEDITOR_NO_ERRORS</Term>
- <ListItem>
- <Para>The file is readable and writable.
- </Para>
- </ListItem>
- </VarListEntry>
- <VarListEntry>
- <Term>DtEDITOR_READ_ONLY_FILE</Term>
- <ListItem>
- <Para>The file is read only.
- <![ %CDE.C.CDE; [</Para>
- </ListItem>
- </VarListEntry>
- <VarListEntry>
- <Term>DtEDITOR_NULLS_REMOVED</Term>
- <ListItem>
- <Para>The file contained embedded
- <SystemItem Class="Constant">NULL</SystemItem> characters, which were removed.
- ]]></Para>
- </ListItem>
- </VarListEntry>
- </VariableList>
- <Para>Otherwise, if it cannot insert the data into the DtEditor widget,
- the function
- returns one of the following values:
- </Para>
- <VariableList>
- <VarListEntry>
- <Term>DtEDITOR_INVALID_RANGE</Term>
- <ListItem>
- <Para>The
- <Symbol Role="Variable">startPos</Symbol> argument is greater than the
- <Symbol Role="Variable">endPos</Symbol> argument.
- </Para>
- </ListItem>
- </VarListEntry>
- <VarListEntry>
- <Term>DtEDITOR_NONEXISTENT_FILE</Term>
- <ListItem>
- <Para>The file does not exist.
- </Para>
- </ListItem>
- </VarListEntry>
- <VarListEntry>
- <Term>DtEDITOR_DIRECTORY</Term>
- <ListItem>
- <Para>The file is a directory.
- </Para>
- </ListItem>
- </VarListEntry>
- <VarListEntry>
- <Term>DtEDITOR_CHAR_SPECIAL_FILE</Term>
- <ListItem>
- <Para>The file is a character-special device.
- </Para>
- </ListItem>
- </VarListEntry>
- <VarListEntry>
- <Term>DtEDITOR_BLOCK_MODE_FILE</Term>
- <ListItem>
- <Para>The file is a block-mode device.
- </Para>
- </ListItem>
- </VarListEntry>
- <VarListEntry>
- <Term>DtEDITOR_NO_FILE_ACCESS</Term>
- <ListItem>
- <Para>The file cannot be accessed.
- <![ %CDE.C.CDE; [</Para>
- </ListItem>
- </VarListEntry>
- <VarListEntry>
- <Term>DtEDITOR_INSUFFICIENT_MEMORY</Term>
- <ListItem>
- <Para>Not enough system memory is available to replace the data.
- ]]></Para>
- </ListItem>
- </VarListEntry>
- <VarListEntry>
- <Term>DtEDITOR_UNREADABLE_FILE</Term>
- <ListItem>
- <Para>The file is unreadable for an unspecified reason.
- </Para>
- </ListItem>
- </VarListEntry>
- </VariableList>
- </RefSect1>
- <RefSect1>
- <Title>APPLICATION USAGE</Title>
- <Para>If the data is in memory, rather than a disk file, the application should
- use
- &cdeman.DtEditorReplace;.</Para>
- </RefSect1>
- <RefSect1>
- <Title>SEE ALSO</Title>
- <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>
- </RefSect1>
- </RefEntry>
- <!--fickle 1.12 mancsf-to-docbook 1.2 08/07/95 23:40:24-->
|