NetSurf
nsoption.c
Go to the documentation of this file.
1/*
2 * Copyright 2016 Chris Young <chris@unsatisfactorysoftware.co.uk>
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#include "amiga/os3support.h"
20
21#include <proto/exec.h>
22#include <proto/utility.h>
23
24#include "utils/nsoption.h"
25#include "amiga/nsoption.h"
26
27static char *current_user_options = NULL;
28
30{
32}
33
35{
36 return nsoption_write(current_user_options, NULL, NULL);
37}
38
40{
41 nserror err = NSERROR_OK;
42
44
46 if(current_user_options == NULL)
47 err = NSERROR_NOMEM;
48
49 return err;
50}
51
53{
54 if(current_user_options != NULL)
55 FreeVec(current_user_options);
56
58}
59
static char * current_user_dir
Definition: gui.c:356
nserror
Enumeration of error codes.
Definition: errors.h:29
@ NSERROR_NOMEM
Memory exhaustion.
Definition: errors.h:32
@ NSERROR_OK
No error.
Definition: errors.h:30
nserror ami_nsoption_read(void)
Definition: nsoption.c:29
nserror ami_nsoption_set_location(const char *current_user_dir)
Definition: nsoption.c:39
void ami_nsoption_free(void)
Definition: nsoption.c:52
nserror ami_nsoption_write(void)
Definition: nsoption.c:34
static char * current_user_options
Definition: nsoption.c:27
char * ASPrintf(const char *fmt,...)
Definition: os3support.c:139
Minimal compatibility header for AmigaOS 3.
nserror nsoption_read(const char *path, struct nsoption_s *opts)
Read choices file and set them in the passed table.
Definition: nsoption.c:696
nserror nsoption_write(const char *path, struct nsoption_s *opts, struct nsoption_s *defs)
Write options that have changed from the defaults to a file.
Definition: nsoption.c:786
Option reading and saving interface.