NetSurf
viewdata.h
Go to the documentation of this file.
1/*
2 * Copyright 2014 Vincent Sanders <vince@netsurf-browser.org>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef _NETSURF_GTK_VIEWDATA_H_
20#define _NETSURF_GTK_VIEWDATA_H_
21
22/**
23 * Display text to a user.
24 *
25 * The data is utf-8 encoded text and will be presented in a window, a
26 * tab or an editor as per the user configuration.
27 *
28 * \param title The title of the data being displayed.
29 * \param filename The suggested filename to be used.
30 * \param data The data to be shown. This data will be freed once the
31 * display is complete, the caller no longer owns the allocation.
32 * \param data_size The size of the data in data.
33 */
34nserror nsgtk_viewdata(const char *title, const char *filename, char *data, size_t data_size);
35
36/**
37 * Display file to a user.
38 *
39 * The file is interpreted as utf-8 encoded text and will be presented
40 * in a window, a tab or an editor as per the user configuration.
41 *
42 * \param title The title of the data being displayed.
43 * \param leafname The suggested leafname to be used.
44 * \param filename The filename of the data to be viewed.
45 */
46nserror nsgtk_viewfile(const char *title, const char *leafname, const char *filename);
47
48#endif
nserror
Enumeration of error codes.
Definition: errors.h:29
nserror nsgtk_viewfile(const char *title, const char *leafname, const char *filename)
Display file to a user.
Definition: viewdata.c:966
nserror nsgtk_viewdata(const char *title, const char *filename, char *data, size_t data_size)
Display text to a user.
Definition: viewdata.c:931