comparison src/database.c @ 482:a04c52f87b6e noffle

[svn] * docs/noffle.1,src/database.h,src/database.c,src/noffle.c,src/server.c: Add new '-U, --uninteresting' option. This removes an article from the list of requested articles and removes its INTERESTING marker.
author bears
date Thu, 14 Oct 2004 00:26:48 +0100
parents 994e9ab2c24f
children
comparison
equal deleted inserted replaced
481:0a5dc5f69746 482:a04c52f87b6e
1 /* 1 /*
2 database.c 2 database.c
3 3
4 $Id: database.c 433 2003-02-13 10:04:01Z bears $ 4 $Id: database.c 629 2004-10-13 23:26:48Z bears $
5 5
6 Uses GNU gdbm library. Using Berkeley db (included in libc6) was 6 Uses GNU gdbm library. Using Berkeley db (included in libc6) was
7 cumbersome. It is based on Berkeley db 1.85, which has severe bugs 7 cumbersome. It is based on Berkeley db 1.85, which has severe bugs
8 (e.g. it is not recommended to delete or overwrite entries with 8 (e.g. it is not recommended to delete or overwrite entries with
9 overflow pages). 9 overflow pages).
770 while ( Cont_nextGrp( grp ) ); 770 while ( Cont_nextGrp( grp ) );
771 771
772 return newClose( ! err ); 772 return newClose( ! err );
773 } 773 }
774 774
775 /* Utility function. Find the upstream server for a particular message. */
776 Bool
777 Db_findServer( const char *msgId, Str server )
778 {
779 const char *p, *pColon, *srv;
780 Str s, grp;
781 Bool res = FALSE;
782
783 if ( Db_contains( msgId ) )
784 {
785 Utl_cpyStr( s, Db_xref( msgId ) );
786 p = strtok( s, " \t" );
787 if ( p )
788 do
789 {
790 pColon = strstr( p, ":" );
791 if ( pColon )
792 {
793 Utl_cpyStrN( grp, p, pColon - p );
794 srv = Grp_server( grp );
795 if ( Cfg_servIsPreferential( srv, server ) )
796 {
797 Utl_cpyStr( server, srv );
798 res = TRUE;
799 }
800 }
801 }
802 while ( ( p = strtok( NULL, " \t" ) ) );
803 }
804
805 return res;
806 }
807