Changeset 7f9df7b9 in mainline for uspace/lib/posix/src/locale.c


Ignore:
Timestamp:
2018-01-22T22:42:57Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7a08c70
Parents:
e0f47f5
Message:

Remove unnecessary symbol renaming from libposix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/posix/src/locale.c

    re0f47f5 r7f9df7b9  
    3333 */
    3434
    35 #define LIBPOSIX_INTERNAL
    36 #define __POSIX_DEF__(x) posix_##x
    37 
    3835#include "internal/common.h"
    3936#include "posix/locale.h"
     
    5451};
    5552
    56 const struct posix_lconv C_LOCALE = {
     53const struct lconv C_LOCALE = {
    5754        .currency_symbol = (char *) "",
    5855        .decimal_point = (char *) ".",
     
    8885 * @return Original locale name on success, NULL on failure.
    8986 */
    90 char *posix_setlocale(int category, const char *locale)
     87char *setlocale(int category, const char *locale)
    9188{
    9289        // TODO
    9390        if (locale == NULL || *locale == '\0' ||
    94             posix_strcmp(locale, "C") == 0) {
     91            strcmp(locale, "C") == 0) {
    9592                return (char *) "C";
    9693        }
     
    103100 * @return Information about the current locale.
    104101 */
    105 struct posix_lconv *posix_localeconv(void)
     102struct lconv *localeconv(void)
    106103{
    107104        // TODO
    108         return (struct posix_lconv *) &C_LOCALE;
     105        return (struct lconv *) &C_LOCALE;
    109106}
    110107
     
    115112 * @return Duplicated object.
    116113 */
    117 posix_locale_t posix_duplocale(posix_locale_t locobj)
     114locale_t duplocale(locale_t locobj)
    118115{
    119116        if (locobj == NULL) {
     
    121118                return NULL;
    122119        }
    123         posix_locale_t copy = malloc(sizeof(struct __posix_locale));
     120        locale_t copy = malloc(sizeof(struct __posix_locale));
    124121        if (copy == NULL) {
    125122                errno = ENOMEM;
     
    135132 * @param locobj Object to free.
    136133 */
    137 void posix_freelocale(posix_locale_t locobj)
     134void freelocale(locale_t locobj)
    138135{
    139136        if (locobj) {
     
    150147 * @return The new/modified locale object.
    151148 */
    152 posix_locale_t posix_newlocale(int category_mask, const char *locale,
    153     posix_locale_t base)
     149locale_t newlocale(int category_mask, const char *locale,
     150    locale_t base)
    154151{
    155152        if (locale == NULL ||
     
    159156        }
    160157        // TODO
    161         posix_locale_t new = malloc(sizeof(struct __posix_locale));
     158        locale_t new = malloc(sizeof(struct __posix_locale));
    162159        if (new == NULL) {
    163160                errno = ENOMEM;
     
    165162        }
    166163        if (base != NULL) {
    167                 posix_freelocale(base);
     164                freelocale(base);
    168165        }
    169166        return new;
     
    176173 * @return The previously set locale or LC_GLOBAL_LOCALE
    177174 */
    178 posix_locale_t posix_uselocale(posix_locale_t newloc)
     175locale_t uselocale(locale_t newloc)
    179176{
    180177        // TODO
Note: See TracChangeset for help on using the changeset viewer.