NetSurf
Functions
viewdata.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

nserror nsgtk_viewdata (const char *title, const char *filename, char *data, size_t data_size)
 Display text to a user. More...
 
nserror nsgtk_viewfile (const char *title, const char *leafname, const char *filename)
 Display file to a user. More...
 

Function Documentation

◆ nsgtk_viewdata()

nserror nsgtk_viewdata ( const char *  title,
const char *  filename,
char *  data,
size_t  data_size 
)

Display text to a user.

The data is utf-8 encoded text and will be presented in a window, a tab or an editor as per the user configuration.

Parameters
titleThe title of the data being displayed.
filenameThe suggested filename to be used.
dataThe data to be shown. This data will be freed once the display is complete, the caller no longer owns the allocation.
data_sizeThe size of the data in data.

Definition at line 931 of file viewdata.c.

References editor_init(), nsgtk_viewdata_ctx::filename, NSERROR_BAD_PARAMETER, NSERROR_OK, nsoption_int, tab_init(), and window_init().

Referenced by nsgtk_viewsource().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nsgtk_viewfile()

nserror nsgtk_viewfile ( const char *  title,
const char *  leafname,
const char *  filename 
)

Display file to a user.

The file is interpreted as utf-8 encoded text and will be presented in a window, a tab or an editor as per the user configuration.

Parameters
titleThe title of the data being displayed.
leafnameThe suggested leafname to be used.
filenameThe filename of the data to be viewed.

Definition at line 966 of file viewdata.c.

References editor_init_fname(), nsgtk_viewdata_ctx::filename, NSERROR_BAD_PARAMETER, nsoption_int, tab_init_fname(), and window_init_fname().

Referenced by debugboxtree_button_clicked_cb(), and debugdomtree_button_clicked_cb().

Here is the call graph for this function:
Here is the caller graph for this function: