DTEDITORREPLACEFROMFILE(3)

πŸ“¦
version 2.5.3 Β· 2 versions
, in nixos 26.05

🌸 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 embedded NULL characters, which were removed.

Otherwise, if it cannot insert the data into the DtEditor widget, the function returns one of these values:

  • DtEDITOR_INVALID_RANGE β€” the startPos argument is greater than the endPos argument.
  • 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 🌈


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