DTEDITORINSERTFROMFILE(3)

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

πŸ’… DtEditorInsertFromFile πŸ’…

okay so bestie, this is a library call page from the DtEditor friend group β€” the original header line is DtEditorInsertFromFile(library call), but we’re folding that manual-name vibe in right here so you don’t have to read it twice 🫢

✨ NAME ✨

DtEditorInsertFromFile β€” insert data from a file into a DtEditor widget. periodt.


πŸŽ€ SYNOPSIS πŸŽ€

#include &<Dt/Editor.h>
DtEditorErrorCode DtEditorInsertFromFile(
Widget widget,
char *fileName);

πŸ’– DESCRIPTION πŸ’–

So DtEditorInsertFromFile inserts data from a file into the insertion cursor position in a DtEditor widget. After the data is inserted, the insertion cursor is positioned after the last character inserted β€” yes, it parks itself right after the new text, iconic ✨

The widget argument specifies the DtEditor widget ID.

The fileName argument is the pathname of the file relative to the local system.

For a complete definition of the DtEditor widget and its associated resources, see DtEditor(3). iykyk πŸ’…


πŸ”₯ RETURN VALUE πŸ”₯

Upon successful completion, DtEditorInsertFromFile 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. not me removing your NULLs πŸ’€

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

  • 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 insert the file.
  • 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 DtEditorInsert(3). that’s the move, bestie 🫢


πŸ¦‹ SEE ALSO πŸ¦‹

the whole little reference crew:


okay that’s the whole page, bestie πŸ’œ footer check: the source/version stamp is DtEditorInsertFromFile(library call), and there’s literally no date printed on this one β€” so I’m not inventing one, no cap. mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from