libusermetrics
MetricManagerAdvancedCAPI.c

A more advanced metric that updates the history of a metric. Usually this would be a metric from an external data source, e.g. e-mail or Facebook messages.

int main(int argc, char *argv[]) {
// We start with a manager object.
// This can be used as a long-lived object to reduce DBus traffic.
// Create a parameters object
// Set its attributes
"<b>%1</b> tweets received today");
"No tweets today");
"myapptextdomain");
// You can hold onto this shared object for as long as you want.
// It will be destroyed when the manager is destroyed.
metricManager, parameters);
// Remember to free the parameters object after use
// The update is sent when the update object is destroyed.
// Providing a blank username string will use the current
// user according to the USER environment variable.
metric, "username");
// The data is ordered starting from today, going backwards in time
// Delete and dispatch the metri update
// Free the manager when done with it
return 0;
}