--- /dev/null 2002-08-30 16:31:37.000000000 -0700
+++ linux/scripts/spellcheck-kernel 2003-02-26 22:51:46.000000000 -0800
@@ -0,0 +1,12 @@
+#!/bin/sh
+# Script to spellcheck kernel.
+# usage: spellcheck-kernel [ sourcedir ]
+# The source directory defaults to /usr/src/linux.
+# e.g.
+# scripts/spellcheck-kernel .
+# Check spelling of the kernel tree in the current directory
+
+sourcedir=${1-/usr/src/linux}
+
+make -C .. scripts/lspell
+find $sourcedir -name '*.[ch]' | xargs ./lspell
--- /dev/null 2002-08-30 16:31:37.000000000 -0700
+++ linux/scripts/lspell.c 2003-02-26 22:51:14.000000000 -0800
@@ -0,0 +1,74 @@
+/*
+ * C comment spell checker
+ * For each given source file, print the filename, then
+ * extract all comments from the file, send them through the system
+ * spellchecker, sort the list of words flagged as misspellings,
+ * and word-wrap the sorted list.
+ * Copyright 2003, Dan Kegel. Licensed under GPL. See the file ../COPYING for details.
+ */
+#include <stdio.h>
+int
+main(int argc, char **argv)
+{
+ int argi;
+
+ for (argi = 1; argi < argc; argi++) {
+ int c;
+ enum state_t { NONCOMMENT, SLASH, COMMENT, STAR, EOLCOMMENT };
+ enum state_t state = NONCOMMENT;
+ FILE *fp = fopen(argv[argi], "rt");
+ if (!fp) {
+ perror(argv[argi]);
+ continue;
+ }
+ FILE *pout = popen("/usr/bin/spell | sort -f | fmt", "w");
+ if (!pout) {
+ perror("/usr/bin/spell | sort -f | fmt");
+ exit(1);
+ }
+ printf("\n%s:\n", argv[argi]);
+ fflush(stdout);
+ while ((c = getc(fp)) != EOF) {
+ switch (state) {
+ case NONCOMMENT:
+ if (c == '/')
+ state = SLASH;
+ break;
+ case SLASH:
+ if (c == '*')
+ state = COMMENT;
+ else if (c == '/')
+ state = EOLCOMMENT;
+ else {
+ state = NONCOMMENT;
+ }
+ break;
+ case COMMENT:
+ if (c == '*')
+ state = STAR;
+ else
+ fputc(c, pout);
+ break;
+ case STAR:
+ if (c == '/')
+ state = NONCOMMENT;
+ else {
+ if (c != '*') {
+ fputc('\n', pout);
+ state = COMMENT;
+ }
+ }
+ break;
+ case EOLCOMMENT:
+ if (c == '\n')
+ state = NONCOMMENT;
+ else
+ fputc(c, pout);
+ break;
+ }
+ }
+ fclose(pout);
+ fclose(fp);
+ }
+ exit(0);
+}
-- Dan Kegel http://www.kegel.com http://counter.li.org/cgi-bin/runscript/display-person.cgi?user=78045- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/