shithub: scc

Download patch

ref: 0b20b4df7d25445bbfbf4d307ffc9ed57dd72ac8
parent: 29c70a1082291f1643b2eff68146385983ceaa76
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Fri Feb 23 10:14:26 EST 2018

[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.

--- a/ar/Makefile
+++ b/ar/Makefile
@@ -5,7 +5,7 @@
 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 @@
 
 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:
--- a/ar/main.c
+++ b/ar/main.c
@@ -7,7 +7,7 @@
 #include <string.h>
 #include <time.h>
 
-#include <stat.h>
+#include <driver.h>
 
 #include "../inc/ar.h"
 #include "../inc/arg.h"
--- /dev/null
+++ b/ar/posix/driver.c
@@ -1,0 +1,14 @@
+static char sccsid[] = "@(#) ./ar/posix/driver.c";
+
+#include "driver.h"
+
+time_t
+totime(unsigned long long t)
+{
+	return t;
+}
+
+int
+setattr()
+{
+}
--- /dev/null
+++ b/ar/posix/driver.h
@@ -1,0 +1,6 @@
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+extern time_t totime(unsigned long long t);
--- a/ar/posix/stat.c
+++ /dev/null
@@ -1,9 +1,0 @@
-static char sccsid[] = "@(#) ./ar/stat.c";
-
-#include "stat.h"
-
-time_t
-totime(unsigned long long t)
-{
-	return t;
-}
--- a/ar/posix/stat.h
+++ /dev/null
@@ -1,5 +1,0 @@
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-