Deleted Added
full compact
iconv.c (227293) iconv.c (227650)
1/*-
2 * Copyright (c) 2000-2001 Boris Popov
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2000-2001 Boris Popov
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/libkern/iconv.c 227293 2011-11-07 06:44:47Z ed $");
28__FBSDID("$FreeBSD: head/sys/libkern/iconv.c 227650 2011-11-18 03:05:20Z kevlo $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/kernel.h>
33#include <sys/iconv.h>
34#include <sys/malloc.h>
35#include <sys/mount.h>
36#include <sys/sx.h>

--- 335 unchanged lines hidden (view full) ---

372 }
373 sx_sunlock(&iconv_lock);
374 return error;
375}
376
377SYSCTL_PROC(_kern_iconv, OID_AUTO, cslist, CTLFLAG_RD | CTLTYPE_OPAQUE,
378 NULL, 0, iconv_sysctl_cslist, "S,xlat", "registered charset pairs");
379
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/kernel.h>
33#include <sys/iconv.h>
34#include <sys/malloc.h>
35#include <sys/mount.h>
36#include <sys/sx.h>

--- 335 unchanged lines hidden (view full) ---

372 }
373 sx_sunlock(&iconv_lock);
374 return error;
375}
376
377SYSCTL_PROC(_kern_iconv, OID_AUTO, cslist, CTLFLAG_RD | CTLTYPE_OPAQUE,
378 NULL, 0, iconv_sysctl_cslist, "S,xlat", "registered charset pairs");
379
380int
381iconv_add(const char *converter, const char *to, const char *from)
382{
383 struct iconv_converter_class *dcp;
384 struct iconv_cspair *csp;
385
386 if (iconv_lookupconv(converter, &dcp) != 0)
387 return EINVAL;
388
389 return iconv_register_cspair(to, from, dcp, NULL, &csp);
390}
391
380/*
381 * Add new charset pair
382 */
383static int
384iconv_sysctl_add(SYSCTL_HANDLER_ARGS)
385{
386 struct iconv_converter_class *dcp;
387 struct iconv_cspair *csp;

--- 176 unchanged lines hidden ---
392/*
393 * Add new charset pair
394 */
395static int
396iconv_sysctl_add(SYSCTL_HANDLER_ARGS)
397{
398 struct iconv_converter_class *dcp;
399 struct iconv_cspair *csp;

--- 176 unchanged lines hidden ---