aboutsummaryrefslogtreecommitdiff
path: root/procfs_file.c
diff options
context:
space:
mode:
authorJeremie Koenig <jk@jk.fr.eu.org>2010-08-23 11:02:48 +0000
committerJeremie Koenig <jk@jk.fr.eu.org>2010-08-30 14:29:53 +0200
commita269783a41ae8b18e5b24d934c96ce9e90de3067 (patch)
treeb352a2e182af1ae23e6ffb69b25830c80ecdd47b /procfs_file.c
parent0439361f817c3f610c1f5ec859bd302867472e50 (diff)
downloadhurd-a269783a41ae8b18e5b24d934c96ce9e90de3067.tar.gz
hurd-a269783a41ae8b18e5b24d934c96ce9e90de3067.tar.bz2
hurd-a269783a41ae8b18e5b24d934c96ce9e90de3067.zip
Remove the unused procfs_file module
* procfs_file.c, procfs_file.h: Remove. * Makefile: Remove procfs_file.
Diffstat (limited to 'procfs_file.c')
-rw-r--r--procfs_file.c54
1 files changed, 0 insertions, 54 deletions
diff --git a/procfs_file.c b/procfs_file.c
deleted file mode 100644
index cb0488e9..00000000
--- a/procfs_file.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#include <hurd/hurd_types.h>
-#include <stdlib.h>
-#include <string.h>
-#include "procfs.h"
-#include "procfs_file.h"
-
-struct procfs_file
-{
- void *contents;
- size_t len;
- void (*cleanup)(void *contents);
-};
-
-error_t
-procfs_file_getcontents (void *hook, void **contents, size_t *contents_len)
-{
- struct procfs_file *f = hook;
-
- *contents = f->contents;
- *contents_len = f->len;
- return 0;
-}
-
-void
-procfs_file_cleanup (void *hook)
-{
- struct procfs_file *f = hook;
-
- if (f->cleanup)
- f->cleanup (f->contents);
-
- free (f);
-}
-
-struct node *
-procfs_file_make_node (void *contents, ssize_t len, void (*cleanup)(void *))
-{
- static const struct procfs_node_ops ops = {
- .get_contents = procfs_file_getcontents,
- .cleanup = procfs_file_cleanup,
- };
- struct procfs_file *f;
-
- f = malloc (sizeof *f);
- if (! f)
- return NULL;
-
- f->contents = contents;
- f->len = (len >= 0) ? len : strlen (f->contents);
- f->cleanup = cleanup;
-
- return procfs_make_node (&ops, f);
-}
-