From 56ba0ac1e3a3f32763060ab862a6f0054c8a50bf Mon Sep 17 00:00:00 2001 From: Jeremie Koenig Date: Tue, 17 Aug 2010 10:26:12 +0000 Subject: 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. --- procfs_dir.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 procfs_dir.h (limited to 'procfs_dir.h') 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); + -- cgit v1.2.3