Changeset 4c8f5e7 in mainline for uspace/lib/posix/locale.c
- Timestamp:
- 2011-08-17T17:42:36Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4419c34
- Parents:
- 903bd436
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/locale.c
r903bd436 r4c8f5e7 42 42 #include "string.h" 43 43 44 // TODO: documentation 44 /* Just a very basic dummy implementation. 45 * This should allow code using locales to work properly, but doesn't provide 46 * any localization functionality. 47 * Should be extended/rewritten when or if HelenOS supports locales natively. 48 */ 45 49 46 50 struct __posix_locale { … … 75 79 }; 76 80 77 /** 81 /** Set program locale. 78 82 * 79 * @param category 80 * @param locale 81 * @return 83 * @param category What category to set. 84 * @param locale Locale name. 85 * @return Original locale name on success, NULL on failure. 82 86 */ 83 87 char *posix_setlocale(int category, const char *locale) … … 91 95 } 92 96 93 /** 97 /** Return locale-specific information. 94 98 * 95 * @return 99 * @return Information about the current locale. 96 100 */ 97 101 struct posix_lconv *posix_localeconv(void) … … 101 105 } 102 106 103 /** 107 /** Duplicate locale object. 104 108 * 105 * @param locobj 106 * @return 109 * @param locobj Object to duplicate. 110 * @return Duplicated object. 107 111 */ 108 112 posix_locale_t posix_duplocale(posix_locale_t locobj) … … 121 125 } 122 126 123 /** 127 /** Free locale object. 124 128 * 125 * @param locobj 129 * @param locobj Object to free. 126 130 */ 127 131 void posix_freelocale(posix_locale_t locobj) … … 132 136 } 133 137 134 /** 138 /** Create or modify a locale object. 135 139 * 136 * @param category_mask 137 * @param locale 138 * @param base 139 * @return 140 * @param category_mask Mask of categories to be set or modified. 141 * @param locale Locale to be used. 142 * @param base Object to modify. 0 if new object is to be created. 143 * @return The new/modified locale object. 140 144 */ 141 145 posix_locale_t posix_newlocale(int category_mask, const char *locale, … … 159 163 } 160 164 161 /** 165 /** Set locale for the current thread. 162 166 * 163 * @param newloc 164 * @return 167 * @param newloc Locale to use. 168 * @return The previously set locale or LC_GLOBAL_LOCALE 165 169 */ 166 170 posix_locale_t posix_uselocale(posix_locale_t newloc) 167 171 { 168 172 // TODO 169 return NULL;173 return LC_GLOBAL_LOCALE; 170 174 } 171 175
Note:
See TracChangeset
for help on using the changeset viewer.