-/* smapi.c: conky support for IBM Thinkpad smapi
+/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
+ * vim: ts=4 sw=4 noet ai cindent syntax=c
+ *
+ * smapi.c: conky support for IBM Thinkpad smapi
*
* Copyright (C) 2007 Phil Sutter <Phil@nwl.cc>
- *
+ *
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
* USA.
*
- * $Id$
- *
*/
-#include "conky.h"
+#define _GNU_SOURCE
+#include "conky.h" /* text_buffer_size, PACKAGE_NAME, maybe more */
+#include "smapi.h"
+#include "logging.h"
#include <stdio.h>
-#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
#include <sys/stat.h>
+#include <sys/types.h>
#define SYS_SMAPI_PATH "/sys/devices/platform/smapi"
if(sscanf(args, "%i %n", &idx, &cnt) <= 0 ||
snprintf(fname, 127, "%s", (args + cnt)) < 0) {
- ERR("smapi: wrong arguments, should be 'bat,<int>,<str>'");
+ NORM_ERR("smapi: wrong arguments, should be 'bat,<int>,<str>'");
return NULL;
}