Changeset eb522e8 in mainline for uspace/lib/c/generic/l18n/langs.c
- Timestamp:
- 2011-06-01T08:43:42Z (14 years ago)
- 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. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/l18n/langs.c
r9e2e715 reb522e8 1 1 /* 2 * Copyright (c) 20 09 Lukas Mejdrech2 * Copyright (c) 2011 Vojtech Horky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup nildummy29 /** @addtogroup libc 30 30 * @{ 31 31 */ 32 33 32 /** @file 34 * Dummy network interface layer module stub. 35 * @see module.c 33 * Language and locale ids. 36 34 */ 37 35 38 #include < async.h>36 #include <l18n/langs.h> 39 37 #include <stdio.h> 40 #include < errno.h>38 #include <fibril.h> 41 39 42 #include <ipc/ipc.h> 43 #include <ipc/services.h> 40 #define UNKNOWN_LOCALE_LEN 64 44 41 45 #include <net/modules.h> 46 #include <net_interface.h> 47 #include <net/packet.h> 48 #include <nil_local.h> 42 static fibril_local char unknown_locale[UNKNOWN_LOCALE_LEN]; 49 43 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 */ 49 const 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 } 51 69 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; 84 73 } 85 74
Note:
See TracChangeset
for help on using the changeset viewer.