summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2010-11-09 18:54:45 +1030
committerRusty Russell <rusty@rustcorp.com.au>2010-11-09 18:54:45 +1030
commit05cdb20aa2d96ec05edd345aa1b7689aa26db87d (patch)
tree42edba754e5b85aad6dddf1e77387cd505b31eeb
parentf91748e6a99dfd3b6565aed4e98e84b4365eb9c2 (diff)
nfs: ccanize a little more.
rename libnfs.h to nfs.h (CCAN expects "main" header to match module name). tools move into tools/, .x file move into rpc/ Don't sed the rpcgen files, generate headers in rpc/ Make tools use <ccan/nfs/nfs.h> as per normal ccan usage.
-rw-r--r--ccan/nfs/Makefile66
-rw-r--r--ccan/nfs/init.c2
-rw-r--r--ccan/nfs/libnfs-sync.c6
-rw-r--r--ccan/nfs/libnfs.c6
-rw-r--r--ccan/nfs/mount.c4
-rw-r--r--ccan/nfs/nfs.c4
-rw-r--r--ccan/nfs/nfs.h (renamed from ccan/nfs/libnfs.h)0
-rw-r--r--ccan/nfs/nfsacl.c4
-rw-r--r--ccan/nfs/pdu.c2
-rw-r--r--ccan/nfs/portmap.c4
-rw-r--r--ccan/nfs/rpc/mount.x (renamed from ccan/nfs/mount.x)0
-rwxr-xr-xccan/nfs/rpc/nfs.x (renamed from ccan/nfs/nfs.x)0
-rw-r--r--ccan/nfs/rpc/nfsacl.x (renamed from ccan/nfs/nfsacl.x)0
-rw-r--r--ccan/nfs/rpc/portmap.x (renamed from ccan/nfs/portmap.x)0
-rw-r--r--ccan/nfs/socket.c2
-rw-r--r--ccan/nfs/tools/nfsclient-async.c (renamed from ccan/nfs/nfsclient-async.c)2
-rw-r--r--ccan/nfs/tools/nfsclient-raw.c (renamed from ccan/nfs/nfsclient-raw.c)6
-rw-r--r--ccan/nfs/tools/nfsclient-sync.c (renamed from ccan/nfs/nfsclient-sync.c)2
18 files changed, 55 insertions, 55 deletions
diff --git a/ccan/nfs/Makefile b/ccan/nfs/Makefile
index f4425d7e..93f325bc 100644
--- a/ccan/nfs/Makefile
+++ b/ccan/nfs/Makefile
@@ -1,79 +1,79 @@
CC=gcc
-CFLAGS=-g -O0 -Wall -W -I. "-D_U_=__attribute__((unused))" -D_FILE_OFFSET_BITS=64
+CFLAGS=-g -O0 -Wall -W -I../.. "-D_U_=__attribute__((unused))" -D_FILE_OFFSET_BITS=64
LIBS=
LIBNFS_OBJ = libnfs-raw-mount.o libnfs-raw-portmap.o libnfs-raw-nfs.o libnfs-raw-nfsacl.o mount.o nfs.o nfsacl.o portmap.o pdu.o init.o socket.o libnfs.o libnfs-sync.o
-all: nfsclient-raw nfsclient-async nfsclient-sync
+all: tools/nfsclient-raw tools/nfsclient-async tools/nfsclient-sync
-nfsclient-async: nfsclient-async.c libnfs.a
- $(CC) -o $@ nfsclient-async.c libnfs.a $(LIBS)
+tools/nfsclient-async: tools/nfsclient-async.c libnfs.a
+ $(CC) $(CFLAGS) -o $@ tools/nfsclient-async.c libnfs.a $(LIBS)
-nfsclient-sync: nfsclient-sync.c libnfs.a
- $(CC) -o $@ nfsclient-sync.c libnfs.a $(LIBS)
+tools/nfsclient-sync: tools/nfsclient-sync.c libnfs.a
+ $(CC) $(CFLAGS) -o $@ tools/nfsclient-sync.c libnfs.a $(LIBS)
-nfsclient-raw: nfsclient-raw.c libnfs.a
- $(CC) -o $@ nfsclient-raw.c libnfs.a $(LIBS)
+tools/nfsclient-raw: tools/nfsclient-raw.c libnfs.a
+ $(CC) $(CFLAGS) -o $@ tools/nfsclient-raw.c libnfs.a $(LIBS)
libnfs.a: $(LIBNFS_OBJ)
@echo Creating library $@
ar r libnfs.a $(LIBNFS_OBJ)
ranlib libnfs.a
-libnfs-raw-mount.h: mount.x
+rpc/mount.h: rpc/mount.x
@echo Generating $@
- rpcgen -h mount.x > libnfs-raw-mount.h
+ rpcgen -h rpc/mount.x > $@
-libnfs-raw-mount.c: mount.x
+libnfs-raw-mount.c: rpc/mount.x
@echo Generating $@
- rpcgen -c mount.x | sed -e "s/#include \"mount.h\"/#include \"libnfs-raw-mount.h\"/" > libnfs-raw-mount.c
+ rpcgen -c rpc/mount.x > libnfs-raw-mount.c
-libnfs-raw-mount.o: libnfs-raw-mount.c libnfs-raw-mount.h
+libnfs-raw-mount.o: libnfs-raw-mount.c rpc/mount.h
@echo Compiling $@
gcc -g -c libnfs-raw-mount.c -o $@
-libnfs-raw-nfs.h: nfs.x
+rpc/nfs.h: rpc/nfs.x
@echo Generating $@
- rpcgen -h nfs.x > libnfs-raw-nfs.h
+ rpcgen -h rpc/nfs.x > $@
-libnfs-raw-nfs.c: nfs.x
+libnfs-raw-nfs.c: rpc/nfs.x
@echo Generating $@
- rpcgen -c nfs.x | sed -e "s/#include \"nfs.h\"/#include \"libnfs-raw-nfs.h\"/" > libnfs-raw-nfs.c
+ rpcgen -c rpc/nfs.x > $@
-libnfs-raw-nfs.o: libnfs-raw-nfs.c libnfs-raw-nfs.h
+libnfs-raw-nfs.o: libnfs-raw-nfs.c rpc/nfs.h
@echo Compiling $@
gcc -g -c libnfs-raw-nfs.c -o $@
-libnfs-raw-nfsacl.h: nfsacl.x
+rpc/nfsacl.h: rpc/nfsacl.x
@echo Generating $@
- rpcgen -h nfsacl.x > libnfs-raw-nfsacl.h
+ rpcgen -h rpc/nfsacl.x > $@
-libnfs-raw-nfsacl.c: nfsacl.x
+libnfs-raw-nfsacl.c: rpc/nfsacl.x
@echo Generating $@
- rpcgen -c nfsacl.x | sed -e "s/#include \"nfsacl.h\"/#include \"libnfs-raw-nfsacl.h\"/" > libnfs-raw-nfsacl.c
+ rpcgen -c rpc/nfsacl.x > $@
-libnfs-raw-nfsacl.o: libnfs-raw-nfsacl.c libnfs-raw-nfsacl.h
+libnfs-raw-nfsacl.o: libnfs-raw-nfsacl.c rpc/nfsacl.h
@echo Compiling $@
gcc -g -c libnfs-raw-nfsacl.c -o $@
-libnfs-raw-portmap.h: portmap.x
+rpc/portmap.h: rpc/portmap.x
@echo Generating $@
- rpcgen -h portmap.x > libnfs-raw-portmap.h
+ rpcgen -h rpc/portmap.x > $@
-libnfs-raw-portmap.c: portmap.x
+libnfs-raw-portmap.c: rpc/portmap.x
@echo Generating $@
- rpcgen -c portmap.x | sed -e "s/#include \"portmap.h\"/#include \"libnfs-raw-portmap.h\"/" > libnfs-raw-portmap.c
+ rpcgen -c rpc/portmap.x > $@
-libnfs-raw-portmap.o: libnfs-raw-portmap.c libnfs-raw-portmap.h
+libnfs-raw-portmap.o: libnfs-raw-portmap.c rpc/portmap.h
@echo Compiling $@
gcc -g -c libnfs-raw-portmap.c -o $@
clean:
rm -f *.o
rm -f *.a
- rm -f libnfs-raw-mount.h libnfs-raw-mount.c
- rm -f libnfs-raw-nfs.h libnfs-raw-nfs.c
- rm -f libnfs-raw-nfsacl.h libnfs-raw-nfsacl.c
- rm -f libnfs-raw-portmap.h libnfs-raw-portmap.c
- rm -f nfsclient-raw nfsclient-async nfsclient-sync
+ rm -f rpc/mount.h libnfs-raw-mount.c
+ rm -f rpc/nfs.h libnfs-raw-nfs.c
+ rm -f rpc/nfsacl.h libnfs-raw-nfsacl.c
+ rm -f rpc/portmap.h libnfs-raw-portmap.c
+ rm -f tools/nfsclient-raw tools/nfsclient-async tools/nfsclient-sync
diff --git a/ccan/nfs/init.c b/ccan/nfs/init.c
index ae0c7878..9bc3c7e8 100644
--- a/ccan/nfs/init.c
+++ b/ccan/nfs/init.c
@@ -23,7 +23,7 @@
#include <strings.h>
#include <rpc/xdr.h>
#include "dlinklist.h"
-#include "libnfs.h"
+#include "nfs.h"
#include "libnfs-raw.h"
#include "libnfs-private.h"
diff --git a/ccan/nfs/libnfs-sync.c b/ccan/nfs/libnfs-sync.c
index f8f98bc1..d6f58f4e 100644
--- a/ccan/nfs/libnfs-sync.c
+++ b/ccan/nfs/libnfs-sync.c
@@ -29,10 +29,10 @@
#include <fcntl.h>
#include <errno.h>
#include <poll.h>
-#include "libnfs.h"
+#include "nfs.h"
#include "libnfs-raw.h"
-#include "libnfs-raw-mount.h"
-#include "libnfs-raw-nfs.h"
+#include "rpc/mount.h"
+#include "rpc/nfs.h"
struct sync_cb_data {
int is_finished;
diff --git a/ccan/nfs/libnfs.c b/ccan/nfs/libnfs.c
index d3257247..025b391d 100644
--- a/ccan/nfs/libnfs.c
+++ b/ccan/nfs/libnfs.c
@@ -29,10 +29,10 @@
#include <utime.h>
#include <unistd.h>
#include <fcntl.h>
-#include "libnfs.h"
+#include "nfs.h"
#include "libnfs-raw.h"
-#include "libnfs-raw-mount.h"
-#include "libnfs-raw-nfs.h"
+#include "rpc/mount.h"
+#include "rpc/nfs.h"
struct nfsfh {
struct nfs_fh3 fh;
diff --git a/ccan/nfs/mount.c b/ccan/nfs/mount.c
index 212eaedc..7c7ac7ec 100644
--- a/ccan/nfs/mount.c
+++ b/ccan/nfs/mount.c
@@ -18,10 +18,10 @@
#include <stdio.h>
#include <errno.h>
#include <rpc/xdr.h>
-#include "libnfs.h"
+#include "nfs.h"
#include "libnfs-raw.h"
#include "libnfs-private.h"
-#include "libnfs-raw-mount.h"
+#include "rpc/mount.h"
int rpc_mount_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data)
diff --git a/ccan/nfs/nfs.c b/ccan/nfs/nfs.c
index 6d3e82f9..dd67be52 100644
--- a/ccan/nfs/nfs.c
+++ b/ccan/nfs/nfs.c
@@ -19,10 +19,10 @@
#include <errno.h>
#include <sys/stat.h>
#include <rpc/xdr.h>
-#include "libnfs.h"
+#include "nfs.h"
#include "libnfs-raw.h"
#include "libnfs-private.h"
-#include "libnfs-raw-nfs.h"
+#include "rpc/nfs.h"
diff --git a/ccan/nfs/libnfs.h b/ccan/nfs/nfs.h
index ec4b6053..ec4b6053 100644
--- a/ccan/nfs/libnfs.h
+++ b/ccan/nfs/nfs.h
diff --git a/ccan/nfs/nfsacl.c b/ccan/nfs/nfsacl.c
index c1053340..71c72cd4 100644
--- a/ccan/nfs/nfsacl.c
+++ b/ccan/nfs/nfsacl.c
@@ -18,10 +18,10 @@
#include <stdio.h>
#include <errno.h>
#include <rpc/xdr.h>
-#include "libnfs.h"
+#include "nfs.h"
#include "libnfs-raw.h"
#include "libnfs-private.h"
-#include "libnfs-raw-nfsacl.h"
+#include "rpc/nfsacl.h"
int rpc_nfsacl_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data)
diff --git a/ccan/nfs/pdu.c b/ccan/nfs/pdu.c
index 0f32d7e0..79c0392f 100644
--- a/ccan/nfs/pdu.c
+++ b/ccan/nfs/pdu.c
@@ -20,7 +20,7 @@
#include <rpc/xdr.h>
#include <rpc/rpc_msg.h>
#include "dlinklist.h"
-#include "libnfs.h"
+#include "nfs.h"
#include "libnfs-raw.h"
#include "libnfs-private.h"
diff --git a/ccan/nfs/portmap.c b/ccan/nfs/portmap.c
index 269aded6..5753736e 100644
--- a/ccan/nfs/portmap.c
+++ b/ccan/nfs/portmap.c
@@ -17,10 +17,10 @@
#include <stdio.h>
#include <rpc/xdr.h>
-#include "libnfs.h"
+#include "nfs.h"
#include "libnfs-raw.h"
#include "libnfs-private.h"
-#include "libnfs-raw-portmap.h"
+#include "rpc/portmap.h"
int rpc_pmap_null_async(struct rpc_context *rpc, rpc_cb cb, void *private_data)
diff --git a/ccan/nfs/mount.x b/ccan/nfs/rpc/mount.x
index 6c2f0713..6c2f0713 100644
--- a/ccan/nfs/mount.x
+++ b/ccan/nfs/rpc/mount.x
diff --git a/ccan/nfs/nfs.x b/ccan/nfs/rpc/nfs.x
index 58fc34e6..58fc34e6 100755
--- a/ccan/nfs/nfs.x
+++ b/ccan/nfs/rpc/nfs.x
diff --git a/ccan/nfs/nfsacl.x b/ccan/nfs/rpc/nfsacl.x
index 68313c98..68313c98 100644
--- a/ccan/nfs/nfsacl.x
+++ b/ccan/nfs/rpc/nfsacl.x
diff --git a/ccan/nfs/portmap.x b/ccan/nfs/rpc/portmap.x
index 8921b92d..8921b92d 100644
--- a/ccan/nfs/portmap.x
+++ b/ccan/nfs/rpc/portmap.x
diff --git a/ccan/nfs/socket.c b/ccan/nfs/socket.c
index b1d0f292..ccdd18df 100644
--- a/ccan/nfs/socket.c
+++ b/ccan/nfs/socket.c
@@ -25,7 +25,7 @@
#include <rpc/xdr.h>
#include <arpa/inet.h>
#include <sys/ioctl.h>
-#include "libnfs.h"
+#include "nfs.h"
#include "libnfs-raw.h"
#include "libnfs-private.h"
#include "dlinklist.h"
diff --git a/ccan/nfs/nfsclient-async.c b/ccan/nfs/tools/nfsclient-async.c
index 4abb901a..feb44781 100644
--- a/ccan/nfs/nfsclient-async.c
+++ b/ccan/nfs/tools/nfsclient-async.c
@@ -31,7 +31,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <poll.h>
-#include "libnfs.h"
+#include <ccan/nfs/nfs.h>
struct client {
char *server;
diff --git a/ccan/nfs/nfsclient-raw.c b/ccan/nfs/tools/nfsclient-raw.c
index 4738bdf9..d9db3734 100644
--- a/ccan/nfs/nfsclient-raw.c
+++ b/ccan/nfs/tools/nfsclient-raw.c
@@ -25,9 +25,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <poll.h>
-#include "libnfs.h"
-#include "libnfs-raw.h"
-#include "libnfs-raw-mount.h"
+#include <ccan/nfs/nfs.h>
+#include <ccan/nfs/libnfs-raw.h>
+#include <ccan/nfs/rpc/mount.h>
struct client {
char *server;
diff --git a/ccan/nfs/nfsclient-sync.c b/ccan/nfs/tools/nfsclient-sync.c
index a9f5265b..e7621092 100644
--- a/ccan/nfs/nfsclient-sync.c
+++ b/ccan/nfs/tools/nfsclient-sync.c
@@ -33,7 +33,7 @@
#include <sys/statvfs.h>
#include <unistd.h>
#include <fcntl.h>
-#include "libnfs.h"
+#include <ccan/nfs/nfs.h>
#include <rpc/rpc.h> /* for authunix_create() */
struct client {