About time I put a licence on this. MIT as usual, naturally.
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 1 Nov 2008 17:44:55 +0000 (17:44 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 1 Nov 2008 17:44:55 +0000 (17:44 +0000)
git-svn-id: svn://svn.tartarus.org/sgt/agedu@8249 cda61777-01e9-0310-a592-d414129be87e

LICENCE [new file with mode: 0644]
Makefile
TODO
agedu.c
licence.c [new file with mode: 0644]

diff --git a/LICENCE b/LICENCE
new file mode 100644 (file)
index 0000000..587556d
--- /dev/null
+++ b/LICENCE
@@ -0,0 +1,21 @@
+agedu is copyright 2008 Simon Tatham. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation files
+(the "Software"), to deal in the Software without restriction,
+including without limitation the rights to use, copy, modify, merge,
+publish, distribute, sublicense, and/or sell copies of the Software,
+and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
index c848ee7..1c12460 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -13,7 +13,7 @@ CFLAGS = -Wall --std=c99 -pedantic $(XFLAGS)
 
 -include Makefile.local
 
-AGEDU_MODULES := agedu du malloc trie index html httpd fgetline
+AGEDU_MODULES := agedu du malloc trie index html httpd fgetline licence
 AGEDU_OBJS := $(patsubst %,%.o,$(AGEDU_MODULES))
 
 ALLMODULES := $(sort $(AGEDU_MODULES))
diff --git a/TODO b/TODO
index 7737503..25b4fd2 100644 (file)
--- a/TODO
+++ b/TODO
@@ -17,10 +17,6 @@ Before it's non-embarrassingly releasable:
       hackery in du.c and turning it into a more sensible run-time
       abstraction layer.
 
- - polish the plain-text output to make it look more like du
-    + configurable recursive output depth
-    + show the right bits last
-
  - cross-Unix portability:
     + use autoconf
        * configure use of stat64
@@ -31,7 +27,7 @@ Before it's non-embarrassingly releasable:
            too, if it's available and O_NOATIME is too.
        * what do we do elsewhere about _GNU_SOURCE?
 
- - man page, licence, --version.
+ - man page, --version.
 
 Future possibilities:
 
diff --git a/agedu.c b/agedu.c
index a104dd7..d015824 100644 (file)
--- a/agedu.c
+++ b/agedu.c
@@ -604,7 +604,15 @@ int main(int argc, char **argv)
                    printf("FIXME: version();\n");
                    return 0;
                  case OPT_LICENCE:
-                   printf("FIXME: licence();\n");
+                   {
+                       extern const char *const licence[];
+                       int i;
+
+                       for (i = 0; licence[i]; i++)
+                           fputs(licence[i], stdout);
+
+                       return 0;
+                   }
                    return 0;
                  case OPT_SCAN:
                    if (nactions >= actionsize) {
diff --git a/licence.c b/licence.c
new file mode 100644 (file)
index 0000000..22627c5
--- /dev/null
+++ b/licence.c
@@ -0,0 +1,24 @@
+const char *const licence[] = {
+    "agedu is copyright 2008 Simon Tatham. All rights reserved.\n",
+    "\n",
+    "Permission is hereby granted, free of charge, to any person\n",
+    "obtaining a copy of this software and associated documentation files\n",
+    "(the \"Software\"), to deal in the Software without restriction,\n",
+    "including without limitation the rights to use, copy, modify, merge,\n",
+    "publish, distribute, sublicense, and/or sell copies of the Software,\n",
+    "and to permit persons to whom the Software is furnished to do so,\n",
+    "subject to the following conditions:\n",
+    "\n",
+    "The above copyright notice and this permission notice shall be\n",
+    "included in all copies or substantial portions of the Software.\n",
+    "\n",
+    "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n",
+    "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n",
+    "MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n",
+    "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS\n",
+    "BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN\n",
+    "ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n",
+    "CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n",
+    "SOFTWARE.\n",
+    0
+};