Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dteditorgetcontents(3) [hpux man page]

DtEditorGetContents(library call)										 DtEditorGetContents(library call)

NAME
DtEditorGetContents -- retrieve the contents of a DtEditor widget SYNOPSIS
#include <Dt/Editor.h> DtEditorErrorCode DtEditorGetContents( Widget widget, DtEditorContentRec *data, Boolean hardCarriageReturns, Boolean markContentsAsSaved); DESCRIPTION
The DtEditorGetContents function retrieves the entire contents of a DtEditor widget as a string, wide character string or sized buffer of data. The data is transferred from the DtEditor widget using a DtEditorContentRec, which indicates the type of data being transferred along with the actual data. If desired, any soft line feeds (word wraps) can be replaced with <newline>s. The DtEditor widget tracks whether its contents have changed since they were last saved or retrieved. Setting the markContentsAsSaved argument to True retrieves a copy of the data without affecting whether DtEditorCheckForUnsavedChanges(3) reports that there are unsaved changes. This is useful if the application needs a temporary copy of the contents. The widget argument specifies the DtEditor widget ID. The data argument is a pointer to a data structure to receive the contents of widget. The hardCarriageReturns argument, if set to True, indicates that the DtEditor widget should replace any soft line feeds (word wraps) with <newline>s when saving the data. When hardCarriageReturns is set to False, any line wrapped because it reaches the right edge of the win- dow is saved as one complete line. The markContentsAsSaved argument, if set to True, causes the DtEditor widget to mark that all changes made to date have been saved. When markContentsAsSaved is set to False, the DtEditor widget does not change its status regarding unsaved changes. For a complete definition of the DtEditor widget and its associated resources, see DtEditor(3). For a complete definition of DtEditorContentRec, see Dt/Editor.h - DtEditor(5). RETURN VALUE
Upon successful completion, the DtEditorGetContents function returns DtEDITOR_NO_ERRORS; otherwise, it returns DtEDITOR_INVALID_TYPE if the Type field is not recognized. EXAMPLES
The following code segment retrieves the contents of a DtEditor widget, marking that all changes to date have been saved. Widget editor; DtEditorContentRec cr; DtEditorErrorCode status; Boolean markContentsAsSaved = True; cr.type = DtEDITOR_TEXT; status = DtEditorGetContents(editor, &cr, False, markContentsAsSaved); if (status == DtEDITOR_NO_ERRORS) printf("The contents are: %s ", cr.value.string); else printf("Unable to retrieve contents of the widget "); APPLICATION USAGE
To write the data directly to a file, the application should use DtEditorSaveContentsToFile(3). SEE ALSO
Dt/Editor.h - DtEditor(5), DtEditor(3), DtEditorAppend(3), DtEditorAppendFromFile(3), DtEditorCheckForUnsavedChanges(3), DtEditorInsert(3), DtEditorInsertFromFile(3), DtEditorReplace(3), DtEditorReplaceFromFile(3), DtEditorSaveContentsToFile(3), DtEditorSetContents(3), DtEdi- torSetContentsFromFile(3). DtEditorGetContents(library call)

Check Out this Related Man Page

DtEditorSetContentsFromFile(library call)								 DtEditorSetContentsFromFile(library call)

NAME
DtEditorSetContentsFromFile -- load data from a file into a DtEditor widget SYNOPSIS
#include <Dt/Editor.h> DtEditorErrorCode DtEditorSetContentsFromFile( Widget widget, char *fileName); DESCRIPTION
The DtEditorSetContentsFromFile function loads the contents of a file into a DtEditor widget. Any data currently in the DtEditor widget is lost. After the data is loaded, the insertion cursor is positioned at the first character. 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). RETURN VALUE
Upon successful completion, the DtEditorSetContentsFromFile function returns one of the following values when it successfully loads the data into the DtEditor widget: 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 load the data into the DtEditor widget, the function returns one of the following 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 load 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 DtEditorSetContents(3). SEE ALSO
Dt/Editor.h - DtEditor(5), DtEditor(3), DtEditorAppend(3), DtEditorAppendFromFile(3), DtEditorGetContents(3), DtEditorInsert(3), DtEdi- torInsertFromFile(3), DtEditorReplace(3), DtEditorReplaceFromFile(3), DtEditorSaveContentsToFile(3), DtEditorSetContents(3). DtEditorSetContentsFromFile(library call)
Man Page