commit 317dbb2eec14864a4a8b23b934091f4c462e22e2
parent c4fda497bf41a1999f4e545ca5be7406eaf49ec4
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date: Fri, 23 Feb 2018 15:14:26 +0000
[ar] Convert stat.c into driver.c
This is done because we are going to need at least
two different functions, one to get the attributes
of a file and other one to set the attributes.
Diffstat:
6 files changed, 24 insertions(+), 18 deletions(-)
diff --git a/ar/Makefile b/ar/Makefile
@@ -5,7 +5,7 @@ LIBDIR = $(PROJECTDIR)/lib/scc
include $(PROJECTDIR)/rules.mk
include $(LIBDIR)/libdep.mk
-OBJ = main.o $(DRIVER)/stat.c
+OBJ = main.o $(DRIVER)/driver.o
MOREFLAGS = -I$(DRIVER)
all: ar-$(DRIVER)
@@ -17,12 +17,12 @@ ar-$(DRIVER): $(OBJ) $(LIBDIR)/libscc.a
main.o: $(PROJECTDIR)/inc/scc.h $(PROJECTDIR)/inc/ar.h
-$(DRIVER)/stat.o: $(DRIVER)/stat.h
+$(DRIVER)/driver.o: $(DRIVER)/driver.h
$(LIBDIR)/libscc.a: $(LIB-OBJ)
+cd $(LIBDIR) && $(MAKE)
-main.o: $(DRIVER)/stat.h
+main.o: $(DRIVER)/driver.h
dep:
clean:
diff --git a/ar/main.c b/ar/main.c
@@ -7,7 +7,7 @@ static char sccsid[] = "@(#) ./ar/main.c";
#include <string.h>
#include <time.h>
-#include <stat.h>
+#include <driver.h>
#include "../inc/ar.h"
#include "../inc/arg.h"
diff --git a/ar/posix/driver.c b/ar/posix/driver.c
@@ -0,0 +1,14 @@
+static char sccsid[] = "@(#) ./ar/posix/driver.c";
+
+#include "driver.h"
+
+time_t
+totime(unsigned long long t)
+{
+ return t;
+}
+
+int
+setattr()
+{
+}
diff --git a/ar/posix/driver.h b/ar/posix/driver.h
@@ -0,0 +1,6 @@
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+extern time_t totime(unsigned long long t);
diff --git a/ar/posix/stat.c b/ar/posix/stat.c
@@ -1,9 +0,0 @@
-static char sccsid[] = "@(#) ./ar/stat.c";
-
-#include "stat.h"
-
-time_t
-totime(unsigned long long t)
-{
- return t;
-}
diff --git a/ar/posix/stat.h b/ar/posix/stat.h
@@ -1,5 +0,0 @@
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-