From a269783a41ae8b18e5b24d934c96ce9e90de3067 Mon Sep 17 00:00:00 2001 From: Jeremie Koenig Date: Mon, 23 Aug 2010 11:02:48 +0000 Subject: Remove the unused procfs_file module * procfs_file.c, procfs_file.h: Remove. * Makefile: Remove procfs_file. --- Makefile | 2 +- procfs_file.c | 54 ------------------------------------------------------ procfs_file.h | 6 ------ 3 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 procfs_file.c delete mode 100644 procfs_file.h diff --git a/Makefile b/Makefile index 9820a76b..b8c055f6 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ TARGET = procfs -OBJS = procfs.o netfs.o procfs_file.o procfs_dir.o \ +OBJS = procfs.o netfs.o procfs_dir.o \ process.o proclist.o rootdir.o dircat.o main.o LIBS = -lnetfs -lps 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 -#include -#include -#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); -} - diff --git a/procfs_file.h b/procfs_file.h deleted file mode 100644 index b615db93..00000000 --- a/procfs_file.h +++ /dev/null @@ -1,6 +0,0 @@ -/* Create a new regular file with the given CONTENTS. If LEN is negative, - CONTENTS is considered as a string and the file stops at the first - nul char. If CLEANUP is non-NULL, it is passed CONTENTS when the - node is destroyed. */ -struct node * -procfs_file_make_node (void *contents, ssize_t len, void (*cleanup)(void *)); -- cgit v1.2.3