summaryrefslogtreecommitdiff
path: root/procfs_dir.h
diff options
context:
space:
mode:
authorJeremie Koenig <jk@jk.fr.eu.org>2010-08-17 10:26:12 +0000
committerJeremie Koenig <jk@jk.fr.eu.org>2010-08-30 14:14:48 +0200
commit56ba0ac1e3a3f32763060ab862a6f0054c8a50bf (patch)
tree5d1c05531572f8eb9e3b6508714d66f4be7ae639 /procfs_dir.h
parent0a4c7a1ca8bff458eb11322d2c94ec9ffd832524 (diff)
Implement simple directories
* procfs_dir.h: New file; declare the procfs_dir_make_node function, based on the procfs_dir_entry structure. * procfs_dir.c: New file; implement simple directories. * Makefile: Add the procfs_dir module. * main.c: Use it.
Diffstat (limited to 'procfs_dir.h')
-rw-r--r--procfs_dir.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/procfs_dir.h b/procfs_dir.h
new file mode 100644
index 0000000..1ba45ad
--- /dev/null
+++ b/procfs_dir.h
@@ -0,0 +1,15 @@
+
+/* Each entry associates a name with a callback function for creating new
+ nodes corresponding to that entry. */
+struct procfs_dir_entry
+{
+ const char *name;
+ struct node *(*make_node)(void *dir_hook, void *entry_hook);
+ void *hook;
+};
+
+/* A simple directory is built from a table of entries. The table is
+ terminated by a null NAME pointer. */
+struct node *
+procfs_dir_make_node (const struct procfs_dir_entry *entries, void *dir_hook);
+