[lkml]   [1997]   [Jan]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Jive -> Kernel (International Linux)
At 23:16 17/01/97 +0000, Philip Blundell wrote:
>On Thu, 16 Jan 1997, William Sowerbutts wrote:
>> Of course, I've no idea how to code this, I'm not a kernel hacker ;) Maybe
>> an "enhanced_printk" type function? This would allow existing kernel code
>> to function, but new code could supplement the existing code. The
>> enhanced_printk function could be implemented merely as a wrapper around
>> the existing printk?
>You could do this with modules. Create a global variable
>printk_language_hook, which defaults to NULL. Then amend printk() to say:
>asmlinkage int printk(const char *fmt, ...)
> [...]
> if (printk_language_hook)
> fmt = printk_language_hook(fmt);
> [...]
>Thus, you can load modules that define printk_language_hook to be a
>pointer to some function that substitutes the original English text with
>something in the chosen language. You'd have to deal with parameters
>somehow, I suppose...

Yes, but this would mean overriding EVERY message the kernel was likely to
give. I still think it's unreasonable to expect every message to be
translated to a target dialect at once. It should be permissable to
translate any messages you see fit to translate, and use the English
defaults for others. How could we implement this on a per-user basis?
Wouldn't that mean passing the kernel messages through a process attached
to the relevant tty, in order to distinguish which user we wanted to
translate for?

On the parameters side, couldn't we do it like vprintf does for printf? (By
this I mean use va_list and friends).

William R Sowerbutts (BtG)
Coder / Guru / Nrrrd
main(){char*s=">#=0> ^#X@#@^7=";int c=0,m;for(;c<15;c++)for

 \ /
  Last update: 2005-03-22 13:38    [W:0.048 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site