* char *timezone_id = NULL;
*
* error_code = i18n_timezone_create_unknown(&timezone);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error creating unknown timezone: %d\n", error_code);
* return EXIT_FAILURE;
* }
* i18n_timezone_get_id(timezone, &timezone_id);
* printf("Created unknown timezone: %s\n", timezone_id);
*
- * i18n_timezone_destroy(timezone);
* free(timezone_id);
+ * i18n_timezone_destroy(timezone);
*
* return EXIT_SUCCESS;
* }
* char *timezone_id = NULL;
*
* error_code = i18n_timezone_create_gmt(&timezone);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error creating GMT timezone: %d\n", error_code);
* return EXIT_FAILURE;
* }
* i18n_timezone_get_id(timezone, &timezone_id);
* printf("Created gmt timezone: %s\n", timezone_id);
*
- * i18n_timezone_destroy(timezone);
* free(timezone_id);
+ * i18n_timezone_destroy(timezone);
*
* return EXIT_SUCCESS;
* }
* char *timezone_id = NULL;
*
* error_code = i18n_timezone_create(&timezone, "Asia/Seoul");
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error creating timezone: %d\n", error_code);
* return EXIT_FAILURE;
* }
* i18n_timezone_get_id(timezone, &timezone_id);
* printf("Created timezone: %s\n", timezone_id);
*
- * i18n_timezone_destroy(timezone);
* free(timezone_id);
+ * i18n_timezone_destroy(timezone);
*
* return EXIT_SUCCESS;
* }
* int32_t index = 0;
* char *equivalent_timezone_id;
* ret = i18n_timezone_get_equivalent_id(timezone_id, index, &equivalent_timezone_id);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error creating timezone: %d\n", error_code);
* return EXIT_FAILURE;
* }
* char *timezone_id = NULL;
*
* error_code = i18n_timezone_create_default(&timezone);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error creating default timezone: %d\n", error_code);
* return EXIT_FAILURE;
* }
* i18n_timezone_get_id(timezone, &timezone_id);
* printf("Created default timezone: %s\n", timezone_id);
*
- * i18n_timezone_destroy(timezone);
* free(timezone_id);
+ * i18n_timezone_destroy(timezone);
*
* return EXIT_SUCCESS;
* }
* char *timezone_id = NULL;
*
* error_code = i18n_timezone_create(&timezone, "Asia/Seoul");
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error creating timezone: %d\n", error_code);
* return EXIT_FAILURE;
* }
* i18n_timezone_get_id(timezone, &timezone_id);
* printf("Created timezone: %s\n", timezone_id);
*
- * i18n_timezone_destroy(timezone);
* free(timezone_id);
+ * i18n_timezone_destroy(timezone);
*
* return EXIT_SUCCESS;
* }
* for(; gmt < 15; gmt++) {
* snprintf(timezone_id, 10, (gmt<0)? "GMT%d:00" : "GMT+%d:00", gmt);
* error_code = i18n_timezone_create(&timezone, timezone_id);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_timezone_create: %d\n", error_code);
* return EXIT_FAILURE;
* }
*
* error_code = i18n_timezone_get_display_name(timezone, &display_name);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_timezone_get_display_name: %d\n", error_code);
* i18n_timezone_destroy(timezone);
* return EXIT_FAILURE;
* printf("Created %s timezone display_name: %s\n", timezone_id, display_name);
* free(display_name);
* i18n_timezone_destroy(timezone);
- * timezone = NULL;
* }
*
* return EXIT_SUCCESS;
* for(; gmt < 15; gmt++) {
* snprintf(timezone_id, 10, (gmt<0)? "GMT%d:00" : "GMT+%d:00", gmt);
* error_code = i18n_timezone_create(&timezone, timezone_id);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_timezone_create: %d\n", error_code);
* return EXIT_FAILURE;
* }
*
* error_code = i18n_timezone_get_display_name_with_locale(timezone, language, country, &display_name);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_timezone_get_display_name_with_locale: %d\n", error_code);
* i18n_timezone_destroy(timezone);
* return EXIT_FAILURE;
* free(display_name);
*
* i18n_timezone_destroy(timezone);
- * timezone = NULL;
* }
*
* return EXIT_SUCCESS;
* type = I18N_TIMEZONE_DISPLAY_TYPE_SHORT;
* snprintf(timezone_id, 10, (gmt<0)? "GMT%d:00" : "GMT+%d:00", gmt);
* error_code = i18n_timezone_create(&timezone, timezone_id);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_timezone_create: %d\n", error_code);
* return EXIT_FAILURE;
* }
*
* for(; type <= I18N_TIMEZONE_DISPLAY_TYPE_GENERIC_LOCATION; type++) {
* error_code = i18n_timezone_get_display_name_with_type(timezone, daylight, type, &display_name);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_timezone_get_display_name_with_type: %d\n", error_code);
* i18n_timezone_destroy(timezone);
* return EXIT_FAILURE;
* }
* printf("Created %s timezone display_name: %s\n", timezone_id, display_name);
- * free(display_name);
+ * free(display_name);
* }
*
* error_code = i18n_timezone_destroy(timezone);
- * timezone = NULL;
* }
*
* return EXIT_SUCCESS;
* char *display_name;
*
* error_code = i18n_timezone_create_default(&timezone);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error creating default timezone: %d\n", error_code);
* return EXIT_FAILURE;
* }
*
* error_code = i18n_timezone_get_display_name_with_type_locale(timezone, daylight, style, language, country, &display_name);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_timezone_get_display_name_with_type_locale: %d\n", error_code);
* i18n_timezone_destroy(timezone);
* return EXIT_FAILURE;
* i18n_timezone_get_id(timezone, &timezone_id);
* printf("Created %s timezone display_name: %s\n", timezone_id, display_name);
*
- * i18n_timezone_destroy(timezone);
- * free(display_name);
* free(timezone_id);
+ * free(display_name);
+ * i18n_timezone_destroy(timezone);
*
* return EXIT_SUCCESS;
* }
* char *timezone_id = NULL;
*
* error_code = i18n_timezone_create_default(&timezone);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error creating default timezone: %d\n", error_code);
* return EXIT_FAILURE;
* }
*
* error_code = i18n_timezone_clone(timezone, &clone);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_timezone_get_display_name_with_type_locale: %d\n", error_code);
* i18n_timezone_destroy(timezone);
* return EXIT_FAILURE;
* i18n_timezone_get_id(clone, &timezone_id);
* printf("Created clone timezone: %s\n", timezone_id);
*
- * i18n_timezone_destroy(timezone);
- * i18n_timezone_destroy(clone);
* free(timezone_id);
+ * i18n_timezone_destroy(clone);
+ * i18n_timezone_destroy(timezone);
*
* return EXIT_SUCCESS;
* }
* char *timezone_id = NULL;
*
* error_code = i18n_timezone_detect_host_timezone(&timezone);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error creating timezone: %d\n", error_code);
* return EXIT_FAILURE;
* }
* i18n_timezone_get_id(timezone, &timezone_id);
* printf("Created timezone: %s\n", timezone_id);
*
- * i18n_timezone_destroy(timezone);
* free(timezone_id);
+ * i18n_timezone_destroy(timezone);
*
* return EXIT_SUCCESS;
* }
* i18n_ustring_from_UTF8((i18n_uchar *)string, I18N_UPRV_LENGTHOF(string), &length, char_str, 5, &error_code);
* if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_ustring_from_UTF8: %d\n", error_code);
- * i18n_uenumeration_destroy(enumeration);
* return EXIT_FAILURE;
* }
*
* error_code = i18n_uset_create_empty(&excluded_set);
* if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_uset_create_empty: %d\n", error_code);
- * i18n_uenumeration_destroy(enumeration);
* return EXIT_FAILURE;
* }
*
* return EXIT_FAILURE;
* }
*
- * i18n_uenumeration_destroy(enumeration);
* i18n_uset_destroy(excluded_set);
* i18n_ucnvsel_destroy(sel);
* return EXIT_SUCCESS;
* #include <string.h>
* #include <stdlib.h>
* #include <utils_i18n.h>
- * #define I18N_UPRV_LENGTHOF(array) (int32_t)(sizeof(array)/sizeof((array)[0]))
*
* int main() {
* i18n_uenumeration_h enumeration = NULL;
* const char *string = "Hello World!";
* i18n_error_code_e error_code;
*
- * error_code = i18n_ucalendar_timezone_id_enumeration_create(I18N_UCALENDAR_ZONE_TYPE_ANY, "US", NULL, &enumeration);
- * if (error_code!= I18N_ERROR_NONE) {
- * printf("Error i18n_ucalendar_timezone_id_enumeration_create: %d\n", error_code);
- * return EXIT_FAILURE;
- * }
- *
* error_code = i18n_uset_create_empty(&excluded_set);
* if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_uset_create_empty: %d\n", error_code);
* error_code = i18n_ucnvsel_select_for_utf8(sel, string, strlen(string), &enumeration);
* if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_ucnvsel_select_for_utf8: %d\n", error_code);
- * i18n_uset_destroy(excluded_set);
* i18n_ucnvsel_destroy(sel);
+ * i18n_uset_destroy(excluded_set);
* return EXIT_FAILURE;
* }
*
- * i18n_uenumeration_destroy(enumeration);
- * i18n_uset_destroy(excluded_set);
* i18n_ucnvsel_destroy(sel);
+ * i18n_uset_destroy(excluded_set);
* return EXIT_SUCCESS;
* }
* @endcode
* #include <utils_i18n.h>
* int main() {
* i18n_error_code_e error_code;
- * i18n_uenumeration_h skeletons = NULL;
+ * i18n_uenumeration_h enumeration = NULL;
* i18n_udatepg_h dtpg = NULL;
* error_code = i18n_udatepg_create_empty(&dtpg);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_udatepg_create_empty: %d\n", error_code);
* return EXIT_FAILURE;
* }
- * error_code = i18n_udatepg_skeletons_create(dtpg, &skeletons);
- * if (error_code!= I18N_ERROR_NONE) {
+ * error_code = i18n_udatepg_skeletons_create(dtpg, &enumeration);
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_udatepg_skeletons_create: %d\n", error_code);
* i18n_udatepg_destroy(dtpg);
* return EXIT_FAILURE;
* }
- * i18n_uenumeration_destroy(skeletons);
+ * i18n_uenumeration_destroy(enumeration);
* i18n_udatepg_destroy(dtpg);
* return EXIT_SUCCESS;
* }
* #include <utils_i18n.h>
* int main() {
* i18n_error_code_e error_code;
- * i18n_uenumeration_h skeletons = NULL;
+ * i18n_uenumeration_h enumeration = NULL;
* i18n_udatepg_h dtpg = NULL;
* error_code = i18n_udatepg_create_empty(&dtpg);
- * if (error_code!= I18N_ERROR_NONE) {
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_udatepg_create_empty: %d\n", error_code);
* return EXIT_FAILURE;
* }
- * error_code = i18n_udatepg_base_skeletons_create(dtpg, &skeletons);
- * if (error_code!= I18N_ERROR_NONE) {
+ * error_code = i18n_udatepg_base_skeletons_create(dtpg, &enumeration);
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_udatepg_base_skeletons_create: %d\n", error_code);
* i18n_udatepg_destroy(dtpg);
* return EXIT_FAILURE;
* }
- * i18n_uenumeration_destroy(skeletons);
+ * i18n_uenumeration_destroy(enumeration);
* i18n_udatepg_destroy(dtpg);
* return EXIT_SUCCESS;
* }
* #include <stdlib.h>
* #include <utils_i18n.h>
* int main() {
- * i18n_uset_h uset = NULL;
- * i18n_uset_h uset_c = NULL;
+ * i18n_uset_h set = NULL;
+ * i18n_uset_h set_clone = NULL;
* i18n_uchar32 start = 0x41;
* i18n_uchar32 end = 0x50;
* i18n_error_code_e error_code;
*
- * error_code = i18n_uset_create(start, end, &uset);
- * if (error_code!= I18N_ERROR_NONE) {
+ * error_code = i18n_uset_create(start, end, &set);
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_uset_create: %d\n", error_code);
* return EXIT_FAILURE;
* }
- * error_code = i18n_uset_clone(uset, &uset_c);
- * if (error_code!= I18N_ERROR_NONE) {
+ * error_code = i18n_uset_clone(set, &set_clone);
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_uset_clone: %d\n", error_code);
- * i18n_uset_destroy(uset);
+ * i18n_uset_destroy(set);
* return EXIT_FAILURE;
* }
- * i18n_uset_destroy(uset);
- * i18n_uset_destroy(uset_c);
- * return EXIT_SUCCESS;
+ * i18n_uset_destroy(set_clone);
+ * i18n_uset_destroy(set);
+ * return EXIT_SUCCESS;
* }
* @endcode
*/
* #include <stdlib.h>
* #include <utils_i18n.h>
* int main() {
- * i18n_uset_h uset = NULL;
- * i18n_uset_h uset_c = NULL;
+ * i18n_uset_h set = NULL;
+ * i18n_uset_h set_copy = NULL;
* i18n_uchar32 start = 0x41;
* i18n_uchar32 end = 0x50;
* i18n_error_code_e error_code;
*
- * error_code = i18n_uset_create(start, end, &uset);
- * if (error_code!= I18N_ERROR_NONE) {
+ * error_code = i18n_uset_create(start, end, &set);
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_uset_create: %d\n", error_code);
* return EXIT_FAILURE;
* }
- * error_code = i18n_uset_clone_as_thawed(uset, &uset_c);
- * if (error_code!= I18N_ERROR_NONE) {
+ * error_code = i18n_uset_clone_as_thawed(set, &set_copy);
+ * if (error_code != I18N_ERROR_NONE) {
* printf("Error i18n_uset_clone_as_thawed: %d\n", error_code);
- * i18n_uset_destroy(uset);
+ * i18n_uset_destroy(set);
* return EXIT_FAILURE;
* }
- * i18n_uset_destroy(uset);
- * i18n_uset_destroy(uset_c);
+ * i18n_uset_destroy(set_copy);
+ * i18n_uset_destroy(set);
* return EXIT_SUCCESS;
* }
* @endcode