home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / UNIX / ARCHIE / CLIENTS / XARCHIE0.TAR / mail / text0018.txt < prev    next >
Encoding:
Text File  |  1991-08-28  |  1.8 KB  |  63 lines

  1. Brendan, here is the latest change to the argument parsing for the
  2. nice option.  I am including a file rdgram.h which includes the limits
  3. for the priorities.
  4.  
  5. George, I don't think the parsing should affect you, but you might
  6. want to use the rdgram.h file for setting you limits.
  7.  
  8.     ~ Cliff
  9. ---rdgram.h---
  10. /*
  11.  * Copyright (c) 1991 by the University of Washington
  12.  *
  13.  * For copying and distribution information, please see the file
  14.  * <uw-copyright.h>.
  15.  */
  16.  
  17. #include <uw-copyright.h>
  18.  
  19. /* Queuing priorities for datagrams */
  20. #define           RDGRAM_MAX_PRI   32765  /* Maximum user proiority          */
  21. #define           RDGRAM_MAX_SPRI  32767  /* Maximum priority for system use */
  22. #define           RDGRAM_MIN_PRI  -32765  /* Maximum user proiority          */
  23. #define           RDGRAM_MIN_SPRI -32768  /* Maximum priority for system use */
  24. ---
  25. *** archie.c.old    Wed Aug 14 20:46:38 1991
  26. --- archie.c    Wed Aug 14 22:30:00 1991
  27. ***************
  28. *** 18,23 ****
  29. --- 18,24 ----
  30.   
  31.   #include <pfs.h>
  32.   #include <perrno.h>
  33. + #include <rdgram.h>
  34.   
  35.   #define ARCHIE_HOST "ARCHIE.CS.MCGILL.CA"
  36.   
  37. ***************
  38. *** 84,92 ****
  39.               cur_arg += strspn(cur_arg,"0123456789");
  40.               break;
  41.   
  42. !         case 'N':  /* Priority (nice, max 32767) */
  43. !             rdgram_priority = 32765; /* Default nice */
  44.               sscanf(cur_arg,"%d",&rdgram_priority);
  45.               cur_arg += strspn(cur_arg,"-0123456789");
  46.               break;
  47.   
  48. --- 85,97 ----
  49.               cur_arg += strspn(cur_arg,"0123456789");
  50.               break;
  51.   
  52. !         case 'N':  /* Priority (nice) */
  53. !             rdgram_priority = RDGRAM_MAX_PRI; /* Default nice */
  54.               sscanf(cur_arg,"%d",&rdgram_priority);
  55. +             if(rdgram_priority > RDGRAM_MAX_SPRI) 
  56. +             rdgram_priority = RDGRAM_MAX_PRI;
  57. +             if(rdgram_priority < RDGRAM_MIN_SPRI) 
  58. +             rdgram_priority = RDGRAM_MIN_PRI;
  59.               cur_arg += strspn(cur_arg,"-0123456789");
  60.               break;
  61.   
  62.  
  63.