Delete load_modules() definition from ulatency.h (func does not exist)
dbus.c: Coding style cleanups

Make whole dbus.c consistent with GNU style
[UHook] Rework

Add u_hood_add_full() to enable passing of user_data and destroy
function.

Hook lists are now hidden in an opaque array. You may access them only
by their type, check them if contain any hooks by calling
u_hook_list_is_setup() and get data associated to them by calling
u_hook_list_get_data().

Hook functions, when invoked, no longer get pointer to UHookData.
Instead they get pointer to user_data passed to u_hook_add_full();
pointer to UHookData may be retrieved by u_hook_list_get_data()

References to UHookData and derived structures are not allowed
because they are shared structures valid only during hooks
invocation. Warning is printed if the ref count is increased after
a hook invocation.

Fixed documentation.
[UHook] Add possibility to invoke hooks by their owner

u_hook_list_invoke_owner()
u_hook_list_invoke_except_owner()
[UHook] Add possibility to remove all hooks from a hook list
UHook] Add hook list type ALL_MODULES_LOADED

Invoked when all modules loaded.
[cleanup] Define _GNU_SOURCE instead of __USE_GNU

__USE_GNU is internal definition of features.h
[USession] Rename u_proc_set_changed_by_session_id()

to u_session_change_processes() so it is later easier to move
every u_proc* stuff to separate file.
1/8 [UFocus] Add hook types usable by (future) focus tracing agents

Idea is to create a subsystem which will track user focus,
reflecting his session (consolekit, logind, ...) which are already
managed by USession subsystem and to create mechanism for focus
tracking agents like xwatch module to register themselves to the
sessions.

User space will be able to notify ulatencyd (via DBUS) about other
focused elements (like terminal tabs or other embedded applications,
GUI elements which don't take input focus etc.) in a way that will
not interfere with active focus tracking agent.

This is the first patch.
2/8 [UFocus] Bind to consolekit signals after all modules loaded

Give other modules opportunity to register hooks to a sessions related
changes; otherwise, should they be focus tracking agents loaded before
this module, they will miss initial sessions.
3/8 [UFocus] Implement UFocusStack (replaces active_users list)

Currently it's a prototype implemented in a flat list, just as
active_users was. This allows me to adapt other parts of code more
quickly, especially adapt and test the xwatch module.

But later this must be reworked into a tree, which will allow accept
user space hints and also make the focus inherited by children processes,
without breaking everything if user focuses terminal with dozens tabs
and applications started from it. Also it should be much faster to
get current process position.

You may find a proposal in docs/UEP/UFocus/focus_tree.dia
4/8 [UFocus] USession: Focus tracker may attach itself to a session

A focus tracker agent (module) may register a hook to
U_HOOK_TYPE_SESSION_FOCUS_TRACKER_CHANGED list, wait for a session which
focus_tracker field changed to NULL, either because a new session was
created or some other tracker released it.

Then the new tracker may attach itself with
u_session_set_focus_tracker().
5/8 [UFocus] Add u_proc_* functions to set focus and get proc position

+ gboolean u_proc_set_focused (u_proc *proc, time_t timestamp);
+ guint16 u_proc_get_focus_position (u_proc *proc, gboolean force);
6/8 [UFocus] Update DBUS interface and ulatency client

DBUS user interface:

Remove setActiveWithUser
Remove setActiveControl
Remove property setActtiveListLength:q
Comment out activeList property - need to be reimplemented it later

Rename setActive => setFocusedPid

Add getFocusStackLength in pid:t, out length:q
Add setFocusStackLength in pid:t, in length:q

ulatency client:

ulatency get activelistlength => ulatency get focusStackLength
ulatency set active => ulatency set focused
7/8 [UFocus] Update xwatch, LUA binding, rules and docblocks

LUA binding:

Removed from ulatency table (fortunately not used anywhere):
 - get_active_uids, l_get_active_uids
 - get_active_pids, l_get_active_pids

These should be reimplemented by UFocus being exported to LUA.

  - ulatency.set_active_pid() replaced by U_PROC:set_focused()

U_PROC.is_active and U_PROC.active_pos replaced by U_PROC.focus_position
8/8 [UFocus] Remove group.c and its declarations from ulatency.h
[doxygen] Set TYPEDEF_HIDES_STRUCT = NO

Because it does not handle forward typedef declarations.
[memleak] Fix memory leak in l_scheduler_list_configs()

Leaked names of all configs everytime called (from dbus.c)
[dbus.c] Ensure correctness of PID arguments passed by dbus

They are read from dbus as uint64 but in reality pid_t is 32bit
signed integer; so make sure (pid_t) uint64 > 0. This has been causing
problems at least in g_hash_lookup() /read access to uninitialized
memory/ called by proc_by_pid() and later in update_processes_run().
[core] Make sure `processes` table is not poisoned by tasks

ulatencyd core must avoid tasks being handled as processes, there is
even test in u_proc_add_task() triggering a warning if u_proc is not
a thread leader.

But PIDs given by user (via DBUS call) must not be thread leaders and
if pushed to process_update_pid() they will poison our #processes
table.

This commit therefore removes PROC_LOOSE_TASKS from OPENPROC_FLAGS
to ensure process_update_pid() and companions cannot poison the
#processes table with tasks.

proc_by_pid_with_retry() was updated to return u_proc of thread leader
if passed pid is a task. But it will be returned only if the task is
already known (in #tasks table). If not, we probably should check
/proc/ to found out if it is an existent task and if it is then
parse its thread leader with process_update_pid().