-#ifndef _LIBKMOD_ARRAY_H_
-#define _LIBKMOD_ARRAY_H_
+#pragma once
/*
* Declaration of struct array is in header because we may want to embed the
void array_free_array(struct array *array);
void array_sort(struct array *array, int (*cmp)(const void *a, const void *b));
int array_remove_at(struct array *array, unsigned int pos);
-
-#endif
-#ifndef _LIBKMOD_HASH_H_
-#define _LIBKMOD_HASH_H_
+#pragma once
#include <stdbool.h>
void hash_iter_init(const struct hash *hash, struct hash_iter *iter);
bool hash_iter_next(struct hash_iter *iter, const char **key,
const void **value);
-
-#endif
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _LIBKMOD_INDEX_H
-#define _LIBKMOD_INDEX_H
+#pragma once
#include <stdint.h>
char *index_mm_search(struct index_mm *idx, const char *key);
struct index_value *index_mm_searchwild(struct index_mm *idx, const char *key);
void index_mm_dump(struct index_mm *idx, int fd, const char *prefix);
-
-#endif
-#ifndef _LIBKMOD_PRIVATE_H_
-#define _LIBKMOD_PRIVATE_H_
+#pragma once
#include <stdbool.h>
#include <stdio.h>
/* util functions */
#include "libkmod-util.h"
-
-#endif
-#ifndef _LIBKMOD_UTIL_H_
-#define _LIBKMOD_UTIL_H_
-
+#pragma once
#include "macro.h"
#include <limits.h>
} *__p = (typeof(__p)) (ptr); \
__p->__v = (val); \
} while(0)
-
-#endif
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#pragma once
#ifndef _LIBKMOD_H_
#define _LIBKMOD_H_
* 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_MACRO_H_
-#define _LIBKMOD_MACRO_H_
+#pragma once
#include <stddef.h>
#define _printf_format_(a,b) __attribute__((format (printf, a, b)))
#define _unused_ __attribute__((unused))
#define _always_inline_ __inline__ __attribute__((always_inline))
-
-#endif
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _LIBKMOD_TESTSUITE_MKDIR_
-#define _LIBKMOD_TESTSUITE_MKDIR_
+#pragma once
#include <sys/stat.h>
#include <sys/types.h>
int mkdir_p(const char *path, mode_t mode);
-
-#endif
-#ifndef _TESTSUITE_STRIPPED_MODULE_H
-#define _TESTSUITE_STRIPPED_MODULE_H
+#pragma once
enum module_state
{
/* padding */
#define MODULE_NAME_OFFSET_64 4 + 4 + 2 * 8
#define MODULE_NAME_OFFSET_32 4 + 2 * 4
-
-#endif
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef _LIBKMOD_TESTSUITE_
-#define _LIBKMOD_TESTSUITE_
+#pragma once
#include <stdbool.h>
#include <stdarg.h>
exit(EXIT_SUCCESS); \
} \
-#endif
-
#define __noreturn __attribute__((noreturn))
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _KMOD_MACRO_H_
-#define _KMOD_MACRO_H_
+#pragma once
#include "macro.h"
extern const struct kmod_cmd kmod_cmd_compat_depmod;
extern const struct kmod_cmd kmod_cmd_list;
-#endif