| Top |
| void | gwy_recent_funcs_record_use () |
| guint | gwy_recent_funcs_get_head () |
| gboolean | gwy_recent_funcs_load () |
| gboolean | gwy_recent_funcs_save () |
Every time a function is used, record it with gwy_recent_funcs_record_use(). You can then use
gwy_recent_funcs_get_head() to obtain a list of the most and/or most recently used functions. The usage weight
slowly fades away over time. Frequently used functions will always come on top. For less used functions, recency
has a larger influence.
void gwy_recent_funcs_record_use (const gchar *kind,const gchar *name);
Records one use of a function.
For meaningful statistics, programmatic execution should not be recorded, only user-invoked functions.
guint gwy_recent_funcs_get_head (const gchar *kind,const gchar **names,guint n);
Obtains a sorted list of most and/or most recently used functions.
The functions are sorted by usage, in descending order. The output array may not be fully filled with function names if there are not enough functions in the usage history. Check the return value. The empty elements are set to NULL.
Normally, only a handful of most recent functions is needed, and the usage recording is designed for that. If you request a long list, recoding future usage can become somewhat inefficient.
gboolean gwy_recent_funcs_load (const gchar *filename,GError **error);
Loads information about recent function usage from a file.
Any existing information is completely replaced. However, this function should normally be only called once during program initialisation.