c9be29333239744a3d24dbe00bb2a1e2188c69f2
2 * libuci - Library for the Unified Configuration Interface
3 * Copyright (C) 2008 Felix Fietkau <nbd@openwrt.org>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License version 2.1
7 * as published by the Free Software Foundation
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
16 * This file contains wrappers to standard functions, which
17 * throw exceptions upon failure.
20 static void *uci_malloc(struct uci_context
*ctx
, size_t size
)
26 UCI_THROW(ctx
, UCI_ERR_MEM
);
32 static void *uci_realloc(struct uci_context
*ctx
, void *ptr
, size_t size
)
34 ptr
= realloc(ptr
, size
);
36 UCI_THROW(ctx
, UCI_ERR_MEM
);
41 static char *uci_strdup(struct uci_context
*ctx
, const char *str
)
47 UCI_THROW(ctx
, UCI_ERR_MEM
);