[comp.lang.c] Logical operations on strings.....

morreale@bierstadt.scd.ucar.edu (Peter W. Morreale) (06/14/91)

I'm about to attempt to implement a routine which will perform logical 
operations on strings (ie: words).   I'd be grateful for any pointers to
established routines (SunOS) , documents, etc....  

To be more specific, I'm writing a small simple database application in which
each entry has a list of keywords associated with it.  I'd like to allow
the user to enter a search string which could contain predefined "logical"
characters.  ie:

Keywords:   aaa bbb ccc

Search string:   aaa | ccc   

With the "|" being defined as a logical OR, the routine would return
TRUE.   Similarly:

Search string:   aaa & ddd | bbb

would also return TRUE.

Even just a small discussion on how to go about implementing such a
routine would be greatly appreciated.

(BTW:  I'm not real interested in interfacing to existing databases,
       this is mostly for my own edification..... )

Thanks,
-PWM
--
------------------------------------------------------------------
Peter W. Morreale                  email:  morreale@ncar.ucar.edu
Nat'l Center for Atmos Research    voice:  (303) 497-1293
Scientific Computing Division