lmonetary.c (f4da1a754daf3d4c20b8747729c0685cd2488bd6) lmonetary.c (8a093dade331ca073d1f487de61710774a5de8c6)
1/*
2 * Copyright (c) 2000, 2001 Alexey Zelkin <phantom@FreeBSD.org>
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

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

31#include <stddef.h>
32#include <stdlib.h>
33#include "lmonetary.h"
34#include "ldpart.h"
35
36extern int __mlocale_changed;
37extern const char * __fix_locale_grouping_str(const char *);
38
1/*
2 * Copyright (c) 2000, 2001 Alexey Zelkin <phantom@FreeBSD.org>
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

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

31#include <stddef.h>
32#include <stdlib.h>
33#include "lmonetary.h"
34#include "ldpart.h"
35
36extern int __mlocale_changed;
37extern const char * __fix_locale_grouping_str(const char *);
38
39#define LCMONETARY_SIZE (sizeof(struct lc_monetary_T) / sizeof(char *))
39#define LCMONETARY_SIZE_FULL (sizeof(struct lc_monetary_T) / sizeof(char *))
40#define LCMONETARY_SIZE_MIN \
41 (offsetof(struct lc_monetary_T, int_p_cs_precedes) / \
42 sizeof(char *))
40
41static char empty[] = "";
42static char numempty[] = { CHAR_MAX, '\0'};
43
44static const struct lc_monetary_T _C_monetary_locale = {
45 empty, /* int_curr_symbol */
46 empty, /* currency_symbol */
47 empty, /* mon_decimal_point */

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

81
82int
83__monetary_load_locale(const char *name)
84{
85 int ret;
86
87 ret = __part_load_locale(name, &_monetary_using_locale,
88 _monetary_locale_buf, "LC_MONETARY",
43
44static char empty[] = "";
45static char numempty[] = { CHAR_MAX, '\0'};
46
47static const struct lc_monetary_T _C_monetary_locale = {
48 empty, /* int_curr_symbol */
49 empty, /* currency_symbol */
50 empty, /* mon_decimal_point */

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

84
85int
86__monetary_load_locale(const char *name)
87{
88 int ret;
89
90 ret = __part_load_locale(name, &_monetary_using_locale,
91 _monetary_locale_buf, "LC_MONETARY",
89 LCMONETARY_SIZE,
90 offsetof(struct lc_monetary_T, int_p_cs_precedes) /
91 sizeof(char *),
92 LCMONETARY_SIZE_FULL, LCMONETARY_SIZE_MIN,
92 (const char **)&_monetary_locale);
93 if (ret != _LDP_ERROR)
94 __mlocale_changed = 1;
95 if (ret == _LDP_LOADED) {
96 _monetary_locale.mon_grouping =
97 __fix_locale_grouping_str(_monetary_locale.mon_grouping);
98
99#define M_ASSIGN_CHAR(NAME) (((char *)_monetary_locale.NAME)[0] = \

--- 79 unchanged lines hidden ---
93 (const char **)&_monetary_locale);
94 if (ret != _LDP_ERROR)
95 __mlocale_changed = 1;
96 if (ret == _LDP_LOADED) {
97 _monetary_locale.mon_grouping =
98 __fix_locale_grouping_str(_monetary_locale.mon_grouping);
99
100#define M_ASSIGN_CHAR(NAME) (((char *)_monetary_locale.NAME)[0] = \

--- 79 unchanged lines hidden ---