DTEDITORREPLACEFROMFILE(3)
πΈ NAME πΈ
okay so bestie, welcome to DtEditorReplaceFromFile β yes, itβs a library call β and its whole thing is replacing a chunk of a DtEditor widgetβs contents with whatever is inside a file. π
β¨ SYNOPSIS β¨
#include &<Dt/Editor.h>
DtEditorErrorCode DtEditorReplaceFromFile(
Widget widget,
XmTextPosition startPos,
XmTextPosition endPos,
char *fileName);
π¦ DESCRIPTION π¦
So DtEditorReplaceFromFile replaces part of a DtEditor widgetβs contents with the contents of a file. Everything after the start position and up to β but not including β the end position gets swapped out. If startPos and endPos are equal, the data is inserted after the end position, periodt. Character positions start 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. Slay. β¨
The widget argument is the DtEditor widget ID. You know her.
The startPos argument is the starting character position of the portion to replace. The replacement begins at this character.
The endPos argument is the ending character position of the portion to replace. The replacement ends before this character.
The fileName argument is the pathname of the file relative to the local system. π«Ά
For the complete definition of the DtEditor widget and its associated resources, see DtEditor(3).
π RETURN VALUE π
Upon successful completion, DtEditorReplaceFromFile returns one of these values:
DtEDITOR_NO_ERRORSβ the file is readable and writable.DtEDITOR_READ_ONLY_FILEβ the file is read only.DtEDITOR_NULLS_REMOVEDβ the file contained embeddedNULLcharacters, which were removed.
Otherwise, if it cannot insert the data into the DtEditor widget, the function returns one of these values:
DtEDITOR_INVALID_RANGEβ thestartPosargument is greater than theendPosargument.DtEDITOR_NONEXISTENT_FILEβ the file does not exist.DtEDITOR_DIRECTORYβ the file is a directory.DtEDITOR_CHAR_SPECIAL_FILEβ the file is a character-special device.DtEDITOR_BLOCK_MODE_FILEβ the file is a block-mode device.DtEDITOR_NO_FILE_ACCESSβ the file cannot be accessed.DtEDITOR_INSUFFICIENT_MEMORYβ not enough system memory is available to replace the data.DtEDITOR_UNREADABLE_FILEβ the file is unreadable for an unspecified reason.
π APPLICATION USAGE π
If the data is in memory rather than a disk file, the application should use DtEditorReplace(3). iykyk π
π SEE ALSO π
Dt/Editor.hβDtEditor(5)DtEditor(3)DtEditorAppend(3)DtEditorAppendFromFile(3)DtEditorGetContents(3)DtEditorInsert(3)DtEditorInsertFromFile(3)DtEditorReplace(3)DtEditorSaveContentsToFile(3)DtEditorSetContents(3)DtEditorSetContentsFromFile(3)
Thatβs the whole page, bestie β DtEditorReplaceFromFile, a library call; no separate version or date line is listed, so this footer energy is all weβve got. π
β¨π
π¦ where this page comes from
- nixos 26.05: cde 2.5.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms