#include <fcntl.h>
#include <sys/types.h>
-#include <array-size/array-size.h>
#include <log/log.h>
#include <pb-protocol/pb-protocol.h>
#include <process/process.h>
#include <system/system.h>
#include <talloc/talloc.h>
#include <url/url.h>
+#include <util/util.h>
#include "device-handler.h"
#include "boot.h"
#include <log/log.h>
#include <types/types.h>
#include <talloc/talloc.h>
-#include <array-size/array-size.h>
+#include <util/util.h>
#include "grub2.h"
#include <log/log.h>
#include <types/types.h>
#include <talloc/talloc.h>
-#include <array-size/array-size.h>
+#include <util/util.h>
#include <discover/parser.h>
#include <discover/file.h>
system/system.c \
system/system.h \
url/url.c \
- url/url.h
+ url/url.h \
+ util/util.h
MAINTAINERCLEANFILES = Makefile.in
+++ /dev/null
-#ifndef ARRAY_SIZE_H
-#define ARRAY_SIZE_H
-
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
-
-#endif /* ARRAY_SIZE_H */
-
#ifndef _LIST_H
#define _LIST_H
+#include <util/util.h>
+
struct list_item {
struct list_item *prev, *next;
};
struct list_item head;
};
-#ifndef container_of
-#define container_of(_ptr, _type, _member) ({ \
- const typeof( ((_type *)0)->_member ) *__mptr = (_ptr); \
- (_type *)( (char *)__mptr - offsetof(_type,_member) );})
-#endif
-
-#ifndef offsetof
-#define offsetof(_type, _member) ((size_t) &((_type *)0)->_member)
-#endif
-
#define list_for_each(_list, _pos) \
for (_pos = (_list)->head.next; _pos != ((_list)->head); _pos = _pos->next)
#include <sys/types.h>
#include <sys/wait.h>
-#include <array-size/array-size.h>
+#include <util/util.h>
#include "pb-config.h"
#include "storage.h"
--- /dev/null
+/*
+ * Copyright (C) 2013 IBM Corporation
+ *
+ * This program 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; version 2 of the License.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef UTIL_H
+#define UTIL_H
+
+#ifndef container_of
+#define container_of(_ptr, _type, _member) ({ \
+ const typeof( ((_type *)0)->_member ) *__mptr = (_ptr); \
+ (_type *)( (char *)__mptr - offsetof(_type,_member) );})
+#endif
+
+#ifndef offsetof
+#define offsetof(_type, _member) ((size_t) &((_type *)0)->_member)
+#endif
+
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+
+#endif /* UTIL_H */
+
#include <string.h>
-#include <array-size/array-size.h>
+#include <util/util.h>
#include <talloc/talloc.h>
#include "parser-test.h"