Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #6505

Re: filters

From lee <lee@yun.yagibdah.de>
Newsgroups comp.lang.c
Subject Re: filters
Date 2011-06-20 16:06 +0200
Organization albasani.net
Message-ID <87tybk1tsy.fsf@yun.yagibdah.de> (permalink)
References (1 earlier) <0.73ef43262f8e8ca91f31.20110618113752BST.87ei2r77cv.fsf@bsb.me.uk> <4dfcd34d.16486840@text.giganews.com> <0.dffdcd7defee49bd5572.20110618231353BST.8739j67ppa.fsf@bsb.me.uk> <4dfe4436.110931874@text.giganews.com> <0.982004441886d4cbdcb8.20110619211646BST.87liwx60gh.fsf@bsb.me.uk>

Show all headers | View raw


Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

> Why would I not take the fact that the question was posted here as
> meaning that C advice was being asked for?  The main reason is that it
> makes no sense for someone to be asking so general a question about
> writing a filter whist at the same time that person has already decided
> what language they'll be using.  I accept that there are reasons that
> this happens (the person knows only C or they are taking a C course and
> the language is therefore pre-decided) but in the absence of a hint
> about that it seemed impolite to assume that the OP wanted only C
> advice.

Well, no, I´m asking for C advice because I´m thinking of writing a
filter in C. That´s why I posted the question in this group, impolitely
assuming that people here would assume it´s a question about writing a
filter in C :)

Though I´m aware that there are languages better suited for the purpose,
C is still the only one I know well enough to use for this, hence the
pre-decision.

I´ve kept the question rather general because I don´t have a particular
problem with writing a filter for a particular purpose yet, as I haven´t
started writing one yet. Currently, I´m thinking about writing one
eventually for the filtering of email.

Since I´m aware of the problem that when reading data from stdin, the
amount of data to be read isn´t limited, I´m wondering how filters deal
with this problem. That makes for a rather general question, of
course. It´s only something I´m trying to learn more about before even
starting to write a filter.


From all the kind replys, I´ve gathered so far that:


* There´s no other choice than to buffer the data read from stdin either
  in memory or in temporary files.

* It depends on what the filter does how large a portion of the data
  read from stdin needs to be.

* Eventually, the filter can terminate with an error.


Now a more specific question: Is there a nice C library useful for
writing a filter for filtering email? There isn´t much point in
re-inventing the wheel, like seperating the headers from the body,
picking out particular headers, searching through the contents of
headers, adding headers and such.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

filters lee <lee@yun.yagibdah.de> - 2011-06-18 12:15 +0200
  Re: filters Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-06-18 11:37 +0100
    Re: filters cri@tiac.net (Richard Harter) - 2011-06-18 18:42 +0000
      Re: filters Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-06-18 23:13 +0100
        Re: filters cri@tiac.net (Richard Harter) - 2011-06-19 19:02 +0000
          Re: filters Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-06-19 21:16 +0100
            Re: filters lee <lee@yun.yagibdah.de> - 2011-06-20 16:06 +0200
              Re: filters Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-06-20 15:53 +0100
                Re: filters lee <lee@yun.yagibdah.de> - 2011-06-27 22:20 +0200
  Re: filters Francois Grieu <fgrieu@gmail.com> - 2011-06-18 13:56 +0200
    Re: filters "Bill Cunningham" <nospam@nspam.invalid> - 2011-06-18 14:24 -0400
      Re: filters Angel <angel+news@spamcop.net> - 2011-06-18 18:51 +0000
        Re: filters Keith Thompson <kst-u@mib.org> - 2011-06-18 11:55 -0700
          Re: filters Angel <angel+news@spamcop.net> - 2011-06-18 19:46 +0000
            Re: filters Keith Thompson <kst-u@mib.org> - 2011-06-18 13:18 -0700
      Re: filters Lew Pitcher <lpitcher@teksavvy.com> - 2011-06-18 14:55 -0400
  Re: filters James Kuyper <jameskuyper@verizon.net> - 2011-06-18 10:14 -0400
    Re: filters cri@tiac.net (Richard Harter) - 2011-06-18 19:58 +0000
    Re: filters Tim Rentsch <txr@alumni.caltech.edu> - 2011-06-19 16:09 -0700
      Re: filters Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-06-20 07:51 +0000
        Re: filters Tim Rentsch <txr@alumni.caltech.edu> - 2011-06-20 12:33 -0700
  Re: filters Nobody <nobody@nowhere.com> - 2011-06-18 15:25 +0100
  Re: filters gordonb.f4hvo@burditt.org (Gordon Burditt) - 2011-06-18 15:17 -0500

csiph-web