[RFC] replace non utf8 always with the same char
Danny Kukawka
danny.kukawka at web.de
Sun Jun 4 20:11:16 PDT 2006
On Sunday 14 May 2006 21:20, Danny Kukawka wrote:
[...]
> No, IMO not. IMO this currently only happen because we have all functions
> and code in the headerfile instead of separated in a header file and a
> .c-file for the code. You also don't get a compiler warning because you
> don't use all functions of util.c/h e.g. in acpi.c
After some time thinking about shared.h and the functions inside the file, I
think we can remove the complete debug stuff and switch the addons and prober
to use the existing code in logger.c/h . This has two advantages:
1.) share code and reduce doubled code
2.) we don't need a new file with debug stuff in CVS
3.) we can use HAL_* (e.g. HAL_ERROR/HAL_DEBUG) for finer grained debug msg.
The only thing left from the file is the function drop_privileges (). After
reading the IRC log from yesterday, I added the files droppriv.c/h to the
(attached) diff as in the patch from Richard.
Btw. IMO we maybe could move the function to utils.c/h , but there are OTOH
maybe to many functions in utils.c we never need in addons/probers. On the
other side we also could add a new helper file where we can collect
addons/specific functionality.
About verify UTF8: We should add the check IMO on a more central place in HAL,
e.g. to libhal_device_set_property_string(). With this solution we would
never need to check utf8 in the helpers.
Please comment ...
Cheers,
Danny
Makefile.am | 3
droppriv.c | 78 +++++++++++++
droppriv.h | 30 +++++
hald.c | 37 ------
linux2/addons/Makefile.am | 14 +-
linux2/addons/addon-acpi-buttons-toshiba.c | 19 +--
linux2/addons/addon-acpi.c | 32 ++---
linux2/addons/addon-hid-ups.c | 9 -
linux2/addons/addon-keyboard.c | 6 -
linux2/addons/addon-pmu.c | 15 +-
linux2/addons/addon-storage.c | 46 +++----
linux2/addons/addon-usb-csr.c | 44 +++----
linux2/probing/Makefile.am | 16 +-
linux2/probing/probe-input.c | 27 ++--
linux2/probing/probe-pc-floppy.c | 16 +-
linux2/probing/probe-printer.c | 24 ++--
linux2/probing/probe-serial.c | 23 ++-
linux2/probing/probe-smbios.c | 14 +-
linux2/probing/probe-storage.c | 38 +++---
linux2/probing/probe-volume.c | 64 +++++-----
linux2/probing/shared.h | 113 -------------------
logger.c | 104 +++++++++++++----
logger.h | 3
23 files changed, 408 insertions(+), 367 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-replace_shared_h_for_helper.diff
Type: text/x-diff
Size: 65993 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20060605/70cc2efe/hal-replace_shared_h_for_helper-0001.bin
More information about the hal
mailing list