[Patch] increase dbus_verbose readability

Ralf Habacker ralf.habacker at freenet.de
Thu Dec 17 03:58:53 PST 2009


Tor Lillqvist schrieb:
> Just a related note:
>
>   
>> +               if (*p == DBUS_DIR_SEPARATOR)
>>     
>
> Please, check for both slash and backslash on Windows, they are
> equivalent (at the Win32, and thus certainly C library, level) and
> either can occur for various reasons. I.e., use a
> DBUS_IS_DIR_SEPARATOR() function-type macro instead of
> DBUS_DIR_SEPARATOR. Something like:
>
> #ifdef DBUS_WIN
> #define DBUS_IS_DIR_SEPARATOR(c) ((c) == '\\' || (c) == '/')
> #else
> #define DBUS_IS_DIR_SEPARATOR(c) ((c) == '/')
> #endif
>   
which probably should go into dbus-sysdeps.h, where the other path 
related functions/macros are located ? 

It's often hard to find the correct location and naming convention 
because dbus uses internal one big context named _dbus_.
These contexts looks like a namespace or class term leaned on from the 
c++ universe or what ever name could be imagined for this kind of grouping

There are some additional contexts like _dbus_file  with functions like

_dbus_file_get_content()  and dbus_file_exist(),

but there are also

_dbus_make_file_world_readable()
_dbus_create_file_exclusively
_dbus_delete_file

which are - at least from my point of view - related  to this dbus_file_ 
context but are named completly different.

I guess

_dbus_file_make_world_readable()
_dbus_file_create_exclusively()
_dbus_file_delete()

would make it clearer. If those functions would be located into a 
specific context related header like dbus-file.h then it would be even 
clearer, which functions are available in the "file related" context.

My guess is that these dbus-sysdeps.h stuff was introduced in the - 
small size - beginning of this project. Now the dbus project has reached 
a size where better approaches (as described above for one topic) would 
make the implementation easier to understand.

Any comments ?

Ralf



More information about the dbus mailing list