Changeset eb522e8 in mainline for uspace/lib/c/generic/l18n/langs.c


Ignore:
Timestamp:
2011-06-01T08:43:42Z (14 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8d6c1f1
Parents:
9e2e715 (diff), e51a514 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Huuuuuge merge from development - all the work actually :)

File:
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/l18n/langs.c

    r9e2e715 reb522e8  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2011 Vojtech Horky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup nildummy
     29/** @addtogroup libc
    3030 * @{
    3131 */
    32 
    3332/** @file
    34  *  Dummy network interface layer module stub.
    35  *  @see module.c
     33 * Language and locale ids.
    3634 */
    3735
    38 #include <async.h>
     36#include <l18n/langs.h>
    3937#include <stdio.h>
    40 #include <errno.h>
     38#include <fibril.h>
    4139
    42 #include <ipc/ipc.h>
    43 #include <ipc/services.h>
     40#define UNKNOWN_LOCALE_LEN 64
    4441
    45 #include <net/modules.h>
    46 #include <net_interface.h>
    47 #include <net/packet.h>
    48 #include <nil_local.h>
     42static fibril_local char unknown_locale[UNKNOWN_LOCALE_LEN];
    4943
    50 #include "nildummy.h"
     44/** Get string representation of a given locale.
     45 *
     46 * @param locale The locale.
     47 * @return Name of the locale.
     48 */
     49const char *str_l18_win_locale(l18_win_locales_t locale)
     50{
     51        /*
     52         * Static array with names might be better but it would be
     53         * way too big.
     54         */
     55        switch (locale) {
     56                case L18N_WIN_LOCALE_AFRIKAANS:
     57                        return "Afrikaans";
     58                case L18N_WIN_LOCALE_CZECH:
     59                        return "Czech";
     60                case L18N_WIN_LOCALE_ENGLISH_UNITED_STATES:
     61                        return "English (US)";
     62                case L18N_WIN_LOCALE_SLOVAK:
     63                        return "Slovak";
     64                case L18N_WIN_LOCALE_SPANISH_TRADITIONAL:
     65                        return "Spanish (traditional)";
     66                case L18N_WIN_LOCALE_ZULU:
     67                        return "Zulu";
     68        }
    5169
    52 int nil_module_start_standalone(async_client_conn_t client_connection)
    53 {
    54         ipcarg_t phonehash;
    55         int rc;
    56        
    57         async_set_client_connection(client_connection);
    58         int net_phone = net_connect_module();
    59        
    60         rc = pm_init();
    61         if (rc != EOK)
    62                 return rc;
    63        
    64        
    65         rc = nil_initialize(net_phone);
    66         if (rc != EOK)
    67                 goto out;
    68        
    69         rc = REGISTER_ME(SERVICE_NILDUMMY, &phonehash);
    70         if (rc != EOK)
    71                 goto out;
    72        
    73         async_manager();
    74 
    75 out:
    76         pm_destroy();
    77         return rc;
    78 }
    79 
    80 int nil_module_message_standalone(const char *name, ipc_callid_t callid,
    81     ipc_call_t *call, ipc_call_t *answer, int *answer_count)
    82 {
    83         return nil_message_standalone(name, callid, call, answer, answer_count);
     70        snprintf(unknown_locale, UNKNOWN_LOCALE_LEN, "Unknown locale 0x%04d",
     71            (int) locale);
     72        return unknown_locale;
    8473}
    8574
Note: See TracChangeset for help on using the changeset viewer.