[Ocfs2-tools-devel] [PATCH 05/11] Ocfs2-tools: Add utils header for o2info.

Tristan Ye tristan.ye at oracle.com
Fri Jan 8 00:50:55 PST 2010


Prototype definition of utils funcs for o2info.

Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
---
 o2info/o2info_utils.h |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)
 create mode 100644 o2info/o2info_utils.h

diff --git a/o2info/o2info_utils.h b/o2info/o2info_utils.h
new file mode 100644
index 0000000..a348efd
--- /dev/null
+++ b/o2info/o2info_utils.h
@@ -0,0 +1,44 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * o2info_utils.h
+ *
+ * Common utility function prototypes
+ *
+ * Copyright (C) 2009 Oracle.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License version 2 as published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+#ifndef __O2INFO_UTILS_H__
+#define __O2INFO_UTILS_H__
+
+#include <glib.h>
+#include "o2info.h"
+
+void o2info_get_incompat_flag(uint32_t flag, GString *str);
+void o2info_get_compat_flag(uint32_t flag, GString *str);
+void o2info_get_rocompat_flag(uint32_t flag, GString *str);
+int o2info_get_filetype(struct stat st, char **filetype);
+int o2info_get_human_permission(mode_t st_mode, uint16_t *perm, char **h_perm);
+int o2info_uid2name(uid_t uid, char **uname);
+int o2info_gid2name(gid_t gid, char **name);
+struct timespec o2info_get_stat_atime(struct stat *st);
+struct timespec o2info_get_stat_ctime(struct stat *st);
+struct timespec o2info_get_stat_mtime(struct stat *st);
+int o2info_get_human_time(char **htime, struct timespec t);
+int o2info_get_human_path(mode_t st_mode, const char *path, char **h_path);
+
+int o2info_is_device(const char *path);
+
+errcode_t o2info_open(struct o2info_method *om, int flags);
+errcode_t o2info_close(struct o2info_method *om);
+
+#endif		/* __O2INFO_UTILS_H__ */
-- 
1.5.5




More information about the Ocfs2-tools-devel mailing list