diskio: convert print functions to match common signature
[monky] / src / smapi.c
index 0a10bae..aa2ea2f 100644 (file)
@@ -1,7 +1,10 @@
-/* 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"
 
@@ -96,7 +102,7 @@ char *smapi_get_bat_val(const char *args)
 
        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;
        }