Mercurial > noffle
comparison src/server.c @ 74:c7df2cc65cc1 noffle
[svn] Introduce UNUSED(x) macro
author | bears |
---|---|
date | Sat, 13 May 2000 16:36:35 +0100 |
parents | 21e778b6c3e9 |
children | 1eb0cdd17c76 |
comparison
equal
deleted
inserted
replaced
73:c874bd3c4bb8 | 74:c7df2cc65cc1 |
---|---|
1 /* | 1 /* |
2 server.c | 2 server.c |
3 | 3 |
4 $Id: server.c 75 2000-05-13 09:25:28Z enz $ | 4 $Id: server.c 80 2000-05-13 15:36:35Z bears $ |
5 */ | 5 */ |
6 | 6 |
7 #if HAVE_CONFIG_H | 7 #if HAVE_CONFIG_H |
8 #include <config.h> | 8 #include <config.h> |
9 #endif | 9 #endif |
201 } | 201 } |
202 | 202 |
203 static Bool | 203 static Bool |
204 notImplemented( char *arg, const Cmd *cmd ) | 204 notImplemented( char *arg, const Cmd *cmd ) |
205 { | 205 { |
206 UNUSED( arg ); | |
207 UNUSED( cmd ); | |
208 | |
206 putStat( STAT_NO_PERMISSION, "Command not implemented" ); | 209 putStat( STAT_NO_PERMISSION, "Command not implemented" ); |
207 return TRUE; | 210 return TRUE; |
208 } | 211 } |
209 | 212 |
210 static void | 213 static void |
476 static Bool | 479 static Bool |
477 doBody( char *arg, const Cmd *cmd ) | 480 doBody( char *arg, const Cmd *cmd ) |
478 { | 481 { |
479 const char *msgId; | 482 const char *msgId; |
480 int numb; | 483 int numb; |
484 | |
485 UNUSED( cmd ); | |
481 | 486 |
482 if ( ! whichId( &msgId, &numb, arg ) ) | 487 if ( ! whichId( &msgId, &numb, arg ) ) |
483 return TRUE; | 488 return TRUE; |
484 putStat( STAT_BODY_FOLLOWS, "%ld %s Body", numb, msgId ); | 489 putStat( STAT_BODY_FOLLOWS, "%ld %s Body", numb, msgId ); |
485 if ( Pseudo_isGeneralInfo( msgId ) ) | 490 if ( Pseudo_isGeneralInfo( msgId ) ) |
500 static Bool | 505 static Bool |
501 doHead( char *arg, const Cmd *cmd ) | 506 doHead( char *arg, const Cmd *cmd ) |
502 { | 507 { |
503 const char *msgId; | 508 const char *msgId; |
504 int numb; | 509 int numb; |
510 | |
511 UNUSED( cmd ); | |
505 | 512 |
506 if ( ! whichId( &msgId, &numb, arg ) ) | 513 if ( ! whichId( &msgId, &numb, arg ) ) |
507 return TRUE; | 514 return TRUE; |
508 putStat( STAT_HEAD_FOLLOWS, "%ld %s Head", numb, msgId ); | 515 putStat( STAT_HEAD_FOLLOWS, "%ld %s Head", numb, msgId ); |
509 if ( Pseudo_isGeneralInfo( msgId ) ) | 516 if ( Pseudo_isGeneralInfo( msgId ) ) |
526 doArt( char *arg, const Cmd *cmd ) | 533 doArt( char *arg, const Cmd *cmd ) |
527 { | 534 { |
528 const char *msgId; | 535 const char *msgId; |
529 int numb; | 536 int numb; |
530 | 537 |
538 UNUSED( cmd ); | |
539 | |
531 if ( ! whichId( &msgId, &numb, arg ) ) | 540 if ( ! whichId( &msgId, &numb, arg ) ) |
532 return TRUE; | 541 return TRUE; |
533 putStat( STAT_ART_FOLLOWS, "%ld %s Article", numb, msgId ); | 542 putStat( STAT_ART_FOLLOWS, "%ld %s Article", numb, msgId ); |
534 if ( Pseudo_isGeneralInfo( msgId ) ) | 543 if ( Pseudo_isGeneralInfo( msgId ) ) |
535 { | 544 { |
546 | 555 |
547 static Bool | 556 static Bool |
548 doHelp( char *arg, const Cmd *cmd ) | 557 doHelp( char *arg, const Cmd *cmd ) |
549 { | 558 { |
550 unsigned int i; | 559 unsigned int i; |
560 | |
561 UNUSED( arg ); | |
562 UNUSED( cmd ); | |
551 | 563 |
552 putStat( STAT_HELP_FOLLOWS, "Help" ); | 564 putStat( STAT_HELP_FOLLOWS, "Help" ); |
553 putTxtBuf( "\nCommands:\n\n" ); | 565 putTxtBuf( "\nCommands:\n\n" ); |
554 for ( i = 0; i < sizeof( commands ) / sizeof( commands[ 0 ] ); ++i ) | 566 for ( i = 0; i < sizeof( commands ) / sizeof( commands[ 0 ] ); ++i ) |
555 putTxtLn( "%s", commands[ i ].syntax ); | 567 putTxtLn( "%s", commands[ i ].syntax ); |
558 } | 570 } |
559 | 571 |
560 static Bool | 572 static Bool |
561 doIhave( char *arg, const Cmd *cmd ) | 573 doIhave( char *arg, const Cmd *cmd ) |
562 { | 574 { |
575 UNUSED( arg ); | |
576 UNUSED( cmd ); | |
577 | |
563 putStat( STAT_ART_REJECTED, "Command not used" ); | 578 putStat( STAT_ART_REJECTED, "Command not used" ); |
564 return TRUE; | 579 return TRUE; |
565 } | 580 } |
566 | 581 |
567 static Bool | 582 static Bool |
568 doLast( char *arg, const Cmd *cmd ) | 583 doLast( char *arg, const Cmd *cmd ) |
569 { | 584 { |
570 int n; | 585 int n; |
586 | |
587 UNUSED( arg ); | |
588 UNUSED( cmd ); | |
571 | 589 |
572 if ( testGrpSelected() ) | 590 if ( testGrpSelected() ) |
573 { | 591 { |
574 n = server.artPtr; | 592 n = server.artPtr; |
575 if ( ! Cont_validNumb( n ) ) | 593 if ( ! Cont_validNumb( n ) ) |
763 doListgrp( char *arg, const Cmd *cmd ) | 781 doListgrp( char *arg, const Cmd *cmd ) |
764 { | 782 { |
765 const Over *ov; | 783 const Over *ov; |
766 int first, last, i; | 784 int first, last, i; |
767 | 785 |
786 UNUSED( cmd ); | |
787 | |
768 if ( ! Grp_exists( arg ) ) | 788 if ( ! Grp_exists( arg ) ) |
769 putStat( STAT_NO_SUCH_GRP, "No such group" ); | 789 putStat( STAT_NO_SUCH_GRP, "No such group" ); |
770 else | 790 else |
771 { | 791 { |
772 changeToGrp( arg ); | 792 changeToGrp( arg ); |
782 } | 802 } |
783 | 803 |
784 static Bool | 804 static Bool |
785 doMode( char *arg, const Cmd *cmd ) | 805 doMode( char *arg, const Cmd *cmd ) |
786 { | 806 { |
807 UNUSED( arg ); | |
808 UNUSED( cmd ); | |
809 | |
787 putStat( STAT_READY_POST_ALLOW, "Ok" ); | 810 putStat( STAT_READY_POST_ALLOW, "Ok" ); |
788 return TRUE; | 811 return TRUE; |
789 } | 812 } |
790 | 813 |
791 /* Can return -1, if date is outside the range of time_t. */ | 814 /* Can return -1, if date is outside the range of time_t. */ |
894 static Bool | 917 static Bool |
895 doNext( char *arg, const Cmd *cmd ) | 918 doNext( char *arg, const Cmd *cmd ) |
896 { | 919 { |
897 int n; | 920 int n; |
898 | 921 |
922 UNUSED(arg); | |
923 UNUSED(cmd); | |
924 | |
899 if ( testGrpSelected() ) | 925 if ( testGrpSelected() ) |
900 { | 926 { |
901 n = server.artPtr; | 927 n = server.artPtr; |
902 if ( ! Cont_validNumb( n ) ) | 928 if ( ! Cont_validNumb( n ) ) |
903 putStat( STAT_NO_ART_SELECTED, "No article selected" ); | 929 putStat( STAT_NO_ART_SELECTED, "No article selected" ); |
1043 DynStr *s; | 1069 DynStr *s; |
1044 Str line, field, val, msgId, from; | 1070 Str line, field, val, msgId, from; |
1045 const char* p; | 1071 const char* p; |
1046 ItemList * newsgroups, *control; | 1072 ItemList * newsgroups, *control; |
1047 | 1073 |
1074 UNUSED(arg); | |
1075 UNUSED(cmd); | |
1076 | |
1048 /* | 1077 /* |
1049 Get article and make following changes to the header: | 1078 Get article and make following changes to the header: |
1050 - add/replace/cut Message-ID depending on config options | 1079 - add/replace/cut Message-ID depending on config options |
1051 - add Reply-To with content of From, if missing | 1080 - add Reply-To with content of From, if missing |
1052 (some providers overwrite From field) | 1081 (some providers overwrite From field) |
1443 } | 1472 } |
1444 | 1473 |
1445 static Bool | 1474 static Bool |
1446 doSlave( char *arg, const Cmd *cmd ) | 1475 doSlave( char *arg, const Cmd *cmd ) |
1447 { | 1476 { |
1477 UNUSED( arg ); | |
1478 UNUSED( cmd ); | |
1479 | |
1448 putStat( STAT_CMD_OK, "Ok" ); | 1480 putStat( STAT_CMD_OK, "Ok" ); |
1449 return TRUE; | 1481 return TRUE; |
1450 } | 1482 } |
1451 | 1483 |
1452 static Bool | 1484 static Bool |
1453 doStat( char *arg, const Cmd *cmd ) | 1485 doStat( char *arg, const Cmd *cmd ) |
1454 { | 1486 { |
1455 const char *msgId; | 1487 const char *msgId; |
1456 int numb; | 1488 int numb; |
1489 | |
1490 UNUSED( cmd ); | |
1457 | 1491 |
1458 if ( ! whichId( &msgId, &numb, arg ) ) | 1492 if ( ! whichId( &msgId, &numb, arg ) ) |
1459 return TRUE; | 1493 return TRUE; |
1460 if ( numb > 0 ) | 1494 if ( numb > 0 ) |
1461 putStat( STAT_ART_RETRIEVED, "%ld %s selected", | 1495 putStat( STAT_ART_RETRIEVED, "%ld %s selected", |
1466 } | 1500 } |
1467 | 1501 |
1468 static Bool | 1502 static Bool |
1469 doQuit( char *arg, const Cmd *cmd ) | 1503 doQuit( char *arg, const Cmd *cmd ) |
1470 { | 1504 { |
1505 UNUSED( arg ); | |
1506 UNUSED( cmd ); | |
1507 | |
1471 putStat( STAT_GOODBYE, "Goodbye" ); | 1508 putStat( STAT_GOODBYE, "Goodbye" ); |
1472 return FALSE; | 1509 return FALSE; |
1473 } | 1510 } |
1474 | 1511 |
1475 static Bool | 1512 static Bool |
1476 doXOver( char *arg, const Cmd *cmd ) | 1513 doXOver( char *arg, const Cmd *cmd ) |
1477 { | 1514 { |
1478 int first, last, i, n; | 1515 int first, last, i, n; |
1479 const Over *ov; | 1516 const Over *ov; |
1480 | 1517 |
1518 UNUSED( cmd ); | |
1519 | |
1481 if ( ! testGrpSelected() ) | 1520 if ( ! testGrpSelected() ) |
1482 return TRUE; | 1521 return TRUE; |
1483 parseRange( arg, &first, &last, &n ); | 1522 parseRange( arg, &first, &last, &n ); |
1484 if ( n == 0 ) | 1523 if ( n == 0 ) |
1485 first = last = server.artPtr; | 1524 first = last = server.artPtr; |