Commit graph

21 commits

Author SHA1 Message Date
Vladimir Serbinenko
f30c692c1f * grub-core/gettext/gettext.c (main_context), (secondary_context):
Define after defining type and not before.
2013-11-07 01:01:47 +01:00
Vladimir Serbinenko
6cd660435e * grub-core/gettext/gettext.c (grub_gettext_init_ext): Ignore errors
if language is English.
2013-11-03 05:42:02 +01:00
Vladimir 'phcoder' Serbinenko
0788a69514 * grub-core/gettext/gettext.c: Try $lang.gmo as well. 2013-05-04 13:40:52 +02:00
Vladimir 'phcoder' Serbinenko
d61357cec2 * grub-core/gettext/gettext.c (grub_gettext_pread): Fix the case when
len = 0.
	(grub_gettext_translate_real): Handle 0th string.
	(grub_gettext_translate): Ensure that "" isn't translated.
2012-04-04 14:41:55 +02:00
Vladimir 'phcoder' Serbinenko
3c0eae66fa * grub-core/gettext/gettext.c (GRUB_MOD_INIT): Handle errors. 2012-03-26 16:07:42 +02:00
Vladimir 'phcoder' Serbinenko
17f38c0f8c Fix gettext reload bugs (e.g. inability to disable gettext
once enabled).

	* grub-core/gettext/gettext.c: Encapsulate all static variables in
	main_context and secondary_context. All functions updated.
	(grub_gettext_translate): Rename to ...
	(grub_gettext_translate_real): ... this. Return NULL on failed
	translate.
	(grub_gettext_translate): Handle secondary context.
	(grub_gettext_delete_list): Close file and zero-out the context.
	(grub_mofile_open): Don't call grub_gettext_delete_list.
	Don't close file.
	(grub_gettext_init_ext): Call grub_gettext_init_ext. Skip loading
	if locale="" to avoid pointless error message.
	(grub_gettext_env_write_lang): Update lang even if load fails.
	Handle secondary context.
	(grub_gettext_reread_prefix): New function.
	(read_main): Likewise.
	(read_secondary): Likewise.
	(GRUB_MOD_INIT): Handle secondary context. Hook and export variables.
	(GRUB_MOD_FINI): Handle secondary context. Don't close file.
	* grub-core/normal/main.c (read_lists): Call grub_gettext_reread_prefix.
	* include/grub/normal.h (grub_gettext_reread_prefix): New proto.
2012-03-10 23:25:34 +01:00
Vladimir 'phcoder' Serbinenko
cf1adfdff5 * grub-core/gettext/gettext.c (grub_mofile_open): Call
grub_gettext_delete_list before changing grub_gettext_max to avoid
	running out of array bounds.
2012-02-28 11:50:53 +01:00
Vladimir 'phcoder' Serbinenko
67093bc0ed Another round of string clarification and adding TRANSLATORS comments. 2012-02-26 17:28:05 +01:00
Vladimir 'phcoder' Serbinenko
d61386e21d Improve string. Gettextize. 2012-02-12 15:25:25 +01:00
Vladimir 'phcoder' Serbinenko
92cd0f6e45 Move platform-dependent files from $prefix to $prefix/$platform.
* config.h.in (GRUB_TARGET_CPU): New definition.
	(GRUB_PLATFORM): Likewise.
	* configure.ac: Define GRUB_TARGET_CPU and GRUB_PLATFORM.
	* grub-core/commands/parttool.c (grub_cmd_parttool): Update dir.
	* grub-core/efiemu/main.c (grub_efiemu_autocore): Likewise.
	* grub-core/kern/dl.c (grub_dl_load): Likewise.
	* grub-core/normal/autofs.c (read_fs_list): Likewise.
	* grub-core/normal/crypto.c (read_crypto_list): Likewise.
	* grub-core/normal/dyncmd.c (read_command_list): Likewise.
	* grub-core/normal/term.c (read_terminal_list): Likewise.
	* grub-core/gettext/gettext.c (grub_mofile_open_lang): Use
	$prefix/locale.
	(grub_gettext_init_ext): Likewise.
	* grub-core/normal/main.c (GRUB_MOD_INIT): Define grub_cpu and
	grub_platform.
	* util/grub-install.in: Update directories.
	* util/grub-mknetdir.in: Likewise.
	* util/grub-mkrescue.in: Likewise.
2012-02-04 21:47:29 +01:00
Vladimir 'phcoder' Serbinenko
c39992a436 * grub-core/gettext/gettext.c: Mostly rewritten to avoid using
lists (by always binsearching), improve caching (cache strings
	used for binsearch, not only results), improve
	maintainability (by using more structured binary search) and correct
	error handling.
2012-02-04 13:35:17 +01:00
Vladimir 'phcoder' Serbinenko
87edb8940a Replace single-linked with double-linked lists. It results in more
compact and more efficient code.

	* grub-core/kern/list.c (grub_list_push): Moved from here ...
	* include/grub/list.h (grub_list_push): ... to here. Set prev.
	(grub_list_remove): Moved from here ...
	* include/grub/list.h (grub_list_remove): ... here. Use and set prev.
	(grub_prio_list_insert): Set prev.
	* include/grub/list.h (grub_list): Add prev. All users updated.
2012-01-24 13:31:12 +01:00
Vladimir 'phcoder' Serbinenko
d35d0d3753 Add const keyword to grub_env_get and gettextize week days.
* grub-core/hook/datehook.c (grub_datetime_names): Make const.
	(grub_read_hook_datetime): Return const char *.
	* grub-core/kern/env.c (grub_env_get): Return const char *. All users
	updated.
	* grub-core/normal/datetime.c (grub_weekday_names): Make const.
	Mark for gettext.
	(grub_get_weekday_name): Return const char *. Call gettext.
	* grub-core/script/argv.c (grub_script_argv_append): Receive const
	char * and len as the argument. All users updated.
	(grub_script_argv_split_append): Receive const char *.
	* include/grub/datetime.h (grub_get_weekday_name): Update proto.
	* include/grub/env.h (grub_env_get): Likewise.
	(grub_env_read_hook_t): Return const char *.
	* include/grub/script_sh.h (grub_script_argv_append): Update proto.
	(grub_script_argv_split_append): Likewise.
2011-11-11 20:34:37 +01:00
Vladimir 'phcoder' Serbinenko
1e51cabd7b * grub-core/gettext/gettext.c (grub_gettext_init_ext): Exit if local is
NULL.
2011-11-03 16:04:26 +01:00
Vladimir 'phcoder' Serbinenko
e745cf0ca6 Implement automatic module license checking according to new GNU
guidelines.

	* grub-core/kern/dl.c (grub_dl_check_license): New function.
	(grub_dl_load_core): Use grub_dl_check_license.
	* include/grub/dl.h (GRUB_MOD_SECTION): New macro.
	(GRUB_MOD_LICENSE): Likewise.
	(GRUB_MOD_DUAL_LICENSE): Likewise.
	All modules updated.
2011-04-11 23:01:51 +02:00
Vladimir 'phcoder' Serbinenko
7d4e39d65a * grub-core/bus/usb/usb.c (attach_hooks): Make static.
* grub-core/bus/usb/usbhub.c (hubs): Likewise.
	* grub-core/commands/hashsum.c (aliases): Likewise.
	* grub-core/commands/setpci.c (pci_registers): Likewise.
	* grub-core/disk/usbms.c (attach_hook): Likewise.
	* grub-core/fs/zfs/zfs.c (decomp_table): Likewise.
	(zio_checksum_table): Likewise.
	* grub-core/gettext/gettext.c (grub_gettext_msg_list): Likewise.
	* grub-core/gfxmenu/gfxmenu.c (cached_view): Likewise.
	* grub-core/lib/legacy_parse.c (legacy_commands): Likewise.
	* grub-core/lib/relocator.c (leftovers): Likewise.
	(extra_blocks): Likewise.
	* grub-core/loader/i386/bsd.c (relocator): Likewise.
	* grub-core/loader/i386/multiboot_mbi.c (modules): Likewise.
	(modules_last): Likewise.
	* grub-core/loader/i386/xnu.c (table_aliases): Likewise.
	(devices): Likewise.
	* grub-core/loader/multiboot_mbi2.c (modules): Likewise.
	(modules_last): Likewise.
	* grub-core/normal/auth.c (users): Likewise.
	* grub-core/normal/context.c (initial_menu): Likewise.
	(current_menu): Likewise.
	* grub-core/normal/crypto.c (crypto_specs): Likewise.
	* grub-core/term/serial.c (grub_serial_ports): Likewise.
	(grub_serial_terminfo_input_template): Likewise.
	(grub_serial_terminfo_output_template): Likewise.
	(grub_serial_terminfo_input): Likewise.
	(grub_serial_terminfo_output): Likewise.
	(registered): Likewise.
	* grub-core/term/usb_keyboard.c (attach_hook): Likewise.
2011-03-23 12:05:13 +01:00
Colin Watson
1fb430f865 * grub-core/gettext/gettext.c (grub_gettext_init_ext): Factor out
.mo/.mo.gz opening sequence to ...
(grub_mofile_open_lang): ... here.
(grub_gettext_init_ext): If opening ll_CC fails, try ll.
* util/grub.d/00_header.in (grub_lang): Include country part of
locale.
Reported by: Mario Limonciello.
2010-12-10 11:45:08 +00:00
Vladimir 'phcoder' Serbinenko
6e3c515d5b * grub-core/gettext/gettext.c (grub_gettext_init_ext): Avoid using
mo_file after freeing.
2010-09-30 21:07:51 +02:00
Vladimir 'phcoder' Serbinenko
fc2ef1172c * grub-core/io/gzio.c (grub_gzio_open): Removed "transparent" parameter.
Made static.
	(grub_gzfile_open): Removed. All users updated.
	(GRUB_MOD_INIT): New function.
	(GRUB_MOD_FINI): Likewise.
	* grub-core/kern/file.c (grub_file_filters_all): New variable.
	(grub_file_filters_enabled): Likewise.
	(grub_file_open): Handle filters.
	* grub-core/loader/i386/bsd.c (GRUB_MOD_INIT): Load gzio.
	* grub-core/normal/main.c (GRUB_MOD_INIT): Likewise.
	* include/grub/file.h (grub_file_filter_id_t): New type.
	(grub_file_filter_t): Likewise.
	(grub_file_filters_all): New extern variable.
	(grub_file_filters_enabled): Likewise.
	(grub_file_filter_register): New inline function.
	(grub_file_filter_unregister): Likewise.
	(grub_file_filter_disable): Likewise.
	(grub_file_filter_disable_compression): Likewise.
	* include/grub/gzio.h: Removed.
2010-09-05 13:05:36 +02:00
BVK Chaitanya
297f0c2b6e merge with mainline 2010-07-13 00:43:28 +05:30
BVK Chaitanya
8c41176882 automake commit without merge history 2010-05-06 11:34:04 +05:30