#include <stdbool.h>
#include <syslog.h>
+#include "libkmod-util.h"
#include "libkmod.h"
-static inline void __attribute__((always_inline, format(printf, 2, 3)))
+static __always_inline __printf_format(2, 3) void
kmod_log_null(struct kmod_ctx *ctx, const char *format, ...) {}
#define kmod_log_cond(ctx, prio, arg...) \
void *data;
};
-struct kmod_list *kmod_list_append(struct kmod_list *list, void *data);
-struct kmod_list *kmod_list_prepend(struct kmod_list *list, void *data);
+struct kmod_list *kmod_list_append(struct kmod_list *list, void *data) __must_check;
+struct kmod_list *kmod_list_prepend(struct kmod_list *list, void *data) __must_check;
struct kmod_list *kmod_list_remove(struct kmod_list *list);
struct kmod_list *kmod_list_remove_data(struct kmod_list *list,
- const void *data);
+ const void *data) __must_check;
#endif
+/*
+ * libkmod - interface to kernel module operations
+ *
+ * Copyright (C) 2011 ProFUSION embedded systems
+ * Copyright (C) 2011 Lucas De Marchi <lucas.de.marchi@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation version 2.1.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
#ifndef _LIBKMOD_UTIL_H_
#define _LIBKMOD_UTIL_H_
((char *)(member_ptr) - offsetof(containing_type, member)) \
- check_types_match(*(member_ptr), ((containing_type *)0)->member))
+#define __must_check __attribute__((warn_unused_result))
+#define __printf_format(a,b) __attribute__((format (printf, a, b)))
+#if !defined(__always_inline)
+#define __always_inline __inline__ __attribute__((always_inline))
+#endif
+
#endif