[imp] Libhttpd.ep and ispell

Brad Hazledine brad.hazledine@caledoncard.com
Sat, 16 Feb 2002 16:47:02 -0500


Quoting Chuck Hagenbuch <chuck@horde.org>:

> Quoting Brad Hazledine <brad.hazledine@caledoncard.com>:
> 
> > We have written one that works but it calls a C program. If you would like
> to
> > have a look then perhaps someone can translate it to PHP.
> 
> Sure, let us have a look...
> 
> -chuck
> 
> --
This seems to work....

#include<stdio.h>

int main(void) {
        int i,c;
        i=0;
        fputc('^',stdout);
        while ((i<4000000) && (!feof(stdin))) {
                i++;
                c=fgetc(stdin);
                if (!feof(stdin)) {
                        if (c=='\r') c='\n';
                        fputc(c,stdout);
                        if (c=='\n') fputc('^',stdout);
                }
        }
        fclose(stdout);
        fclose(stdin);
}

And we changed the line to...
exec("echo $tocheck | prefixer | " . $conf['utils']['spellchecker'] . ' -a ' . 
$spell_opt, $warnings);

Brad